diff options
| author | Yangtao Li <tiny.windzz@gmail.com> | 2019-12-29 08:06:08 +0000 |
|---|---|---|
| committer | Thierry Reding <thierry.reding@gmail.com> | 2020-11-11 19:00:14 +0100 |
| commit | a60a8beb0d6c222ad086467ecdd69a821f53f338 (patch) | |
| tree | 5545d3d6cf5446dcb34e17cbbf9c2d8c925d3c66 | |
| parent | 572cb50e4a1656f019dc3bd3519e6fa0a0347382 (diff) | |
| download | linux-next-a60a8beb0d6c222ad086467ecdd69a821f53f338.tar.gz | |
pwm: hibvt: Convert to devm_platform_ioremap_resource()
Notice: this object is not reachable from any branch.
Use devm_platform_ioremap_resource() to simplify code. While at it, also
declare the "i" and "ret" variables on the same line since they are of
the same type.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Notice: this object is not reachable from any branch.
| -rw-r--r-- | drivers/pwm/pwm-hibvt.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-hibvt.c b/drivers/pwm/pwm-hibvt.c index ad205fdad3722..a1900d0a872e5 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); |
