Message ID | 20191229080610.7597-25-tiny.windzz@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/32] pwm: sun4i: convert to devm_platform_ioremap_resource | expand |
On Sun, 2019-12-29 at 08:06 +0000, Yangtao Li wrote: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> > --- Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Thanks! > drivers/pwm/pwm-brcmstb.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c > index fea612c45f20..8b66f9d2f589 100644 > --- a/drivers/pwm/pwm-brcmstb.c > +++ b/drivers/pwm/pwm-brcmstb.c > @@ -234,7 +234,6 @@ MODULE_DEVICE_TABLE(of, brcmstb_pwm_of_match); > static int brcmstb_pwm_probe(struct platform_device *pdev) > { > struct brcmstb_pwm *p; > - struct resource *res; > int ret; > > p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); > @@ -262,8 +261,7 @@ static int brcmstb_pwm_probe(struct platform_device *pdev) > p->chip.base = -1; > p->chip.npwm = 2; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - p->base = devm_ioremap_resource(&pdev->dev, res); > + p->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(p->base)) { > ret = PTR_ERR(p->base); > goto out_clk;
Hello, On Sun, Dec 29, 2019 at 08:06:03AM +0000, Yangtao Li wrote: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Thanks, Uwe
diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c index fea612c45f20..8b66f9d2f589 100644 --- a/drivers/pwm/pwm-brcmstb.c +++ b/drivers/pwm/pwm-brcmstb.c @@ -234,7 +234,6 @@ MODULE_DEVICE_TABLE(of, brcmstb_pwm_of_match); static int brcmstb_pwm_probe(struct platform_device *pdev) { struct brcmstb_pwm *p; - struct resource *res; int ret; p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL); @@ -262,8 +261,7 @@ static int brcmstb_pwm_probe(struct platform_device *pdev) p->chip.base = -1; p->chip.npwm = 2; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - p->base = devm_ioremap_resource(&pdev->dev, res); + p->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(p->base)) { ret = PTR_ERR(p->base); goto out_clk;
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> --- drivers/pwm/pwm-brcmstb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)