2019-09-04 11:59:57

by Yue Haibing

[permalink] [raw]
Subject: [PATCH -next] fbdev: s3c-fb: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
drivers/video/fbdev/s3c-fb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
index ba04d7a..43ac8d7 100644
--- a/drivers/video/fbdev/s3c-fb.c
+++ b/drivers/video/fbdev/s3c-fb.c
@@ -1411,8 +1411,7 @@ static int s3c_fb_probe(struct platform_device *pdev)

pm_runtime_enable(sfb->dev);

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- sfb->regs = devm_ioremap_resource(dev, res);
+ sfb->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(sfb->regs)) {
ret = PTR_ERR(sfb->regs);
goto err_lcd_clk;
--
2.7.4



2019-09-17 20:05:57

by Jingoo Han

[permalink] [raw]
Subject: Re: [PATCH -next] fbdev: s3c-fb: use devm_platform_ioremap_resource() to simplify code



On 9/4/19, 7:57 AM, YueHaibing wrote:

> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>
>
Acked-by: Jingoo Han <[email protected]>
>
> ---
> drivers/video/fbdev/s3c-fb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
> index ba04d7a..43ac8d7 100644
> --- a/drivers/video/fbdev/s3c-fb.c
> +++ b/drivers/video/fbdev/s3c-fb.c
> @@ -1411,8 +1411,7 @@ static int s3c_fb_probe(struct platform_device *pdev)
>
> pm_runtime_enable(sfb->dev);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - sfb->regs = devm_ioremap_resource(dev, res);
> + sfb->regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(sfb->regs)) {
> ret = PTR_ERR(sfb->regs);
> goto err_lcd_clk;
> --
> 2.7.4


Subject: Re: [PATCH -next] fbdev: s3c-fb: use devm_platform_ioremap_resource() to simplify code


On 9/17/19 9:21 PM, Jingoo Han wrote:
>
>
> On 9/4/19, 7:57 AM, YueHaibing wrote:
>
>> Use devm_platform_ioremap_resource() to simplify the code a bit.
>> This is detected by coccinelle.
>>
>> Reported-by: Hulk Robot <[email protected]>
>> Signed-off-by: YueHaibing <[email protected]>
>>
> Acked-by: Jingoo Han <[email protected]>

Thanks, patch queued for v5.6 (also sorry for the delay).

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

>> ---
>> drivers/video/fbdev/s3c-fb.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/s3c-fb.c b/drivers/video/fbdev/s3c-fb.c
>> index ba04d7a..43ac8d7 100644
>> --- a/drivers/video/fbdev/s3c-fb.c
>> +++ b/drivers/video/fbdev/s3c-fb.c
>> @@ -1411,8 +1411,7 @@ static int s3c_fb_probe(struct platform_device *pdev)
>>
>> pm_runtime_enable(sfb->dev);
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - sfb->regs = devm_ioremap_resource(dev, res);
>> + sfb->regs = devm_platform_ioremap_resource(pdev, 0);
>> if (IS_ERR(sfb->regs)) {
>> ret = PTR_ERR(sfb->regs);
>> goto err_lcd_clk;
>> --
>> 2.7.4