[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191229080610.7597-30-tiny.windzz@gmail.com>
Date: Sun, 29 Dec 2019 08:06:08 +0000
From: Yangtao Li <tiny.windzz@...il.com>
To: claudiu.beznea@...rochip.com, thierry.reding@...il.com,
u.kleine-koenig@...gutronix.de, nicolas.ferre@...rochip.com,
alexandre.belloni@...tlin.com, ludovic.desroches@...rochip.com,
rjui@...adcom.com, sbranden@...adcom.com,
bcm-kernel-feedback-list@...adcom.com, f.fainelli@...il.com,
nsaenzjulienne@...e.de, shc_work@...l.ru, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com, vz@...ia.com, slemieux.tyco@...il.com,
khilman@...libre.com, matthias.bgg@...il.com, heiko@...ech.de,
palmer@...belt.com, paul.walmsley@...ive.com, mripard@...nel.org,
wens@...e.org, jonathanh@...dia.com, linux@...sktech.co.nz,
linux-arm-kernel@...ts.infradead.org, linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
linux-riscv@...ts.infradead.org, linux-tegra@...r.kernel.org
Cc: Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH 30/32] pwm: hibvt: do some cleanup
Use devm_platform_ioremap_resource() to simplify code.
'i' and 'ret' are variables of the same type and there is no
need to use two lines.
Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
drivers/pwm/pwm-hibvt.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c
index ad205fdad372..a1900d0a872e 100644
--- a/drivers/pwm/pwm-hibvt.c
+++ b/drivers/pwm/pwm-hibvt.c
@@ -190,9 +190,7 @@ static int hibvt_pwm_probe(struct platform_device *pdev)
const struct hibvt_pwm_soc *soc =
of_device_get_match_data(&pdev->dev);
struct hibvt_pwm_chip *pwm_chip;
- struct resource *res;
- int ret;
- int i;
+ int ret, i;
pwm_chip = devm_kzalloc(&pdev->dev, sizeof(*pwm_chip), GFP_KERNEL);
if (pwm_chip == NULL)
@@ -213,8 +211,7 @@ static int hibvt_pwm_probe(struct platform_device *pdev)
pwm_chip->chip.of_pwm_n_cells = 3;
pwm_chip->soc = soc;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- pwm_chip->base = devm_ioremap_resource(&pdev->dev, res);
+ pwm_chip->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pwm_chip->base))
return PTR_ERR(pwm_chip->base);
--
2.17.1
Powered by blists - more mailing lists