mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe()
@ 2019-09-19 14:33 ` Markus Elfring
  2020-01-03 12:33   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-19 14:33 UTC (permalink / raw)
  To: linux-fbdev, dri-devel, Bartlomiej Zolnierkiewicz
  Cc: LKML, kernel-janitors, Bartosz Golaszewski, Himanshu Jha

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 19 Sep 2019 16:26:56 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/video/fbdev/ocfb.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c
index a970edc2a6f8..be308b4dc91d 100644
--- a/drivers/video/fbdev/ocfb.c
+++ b/drivers/video/fbdev/ocfb.c
@@ -297,7 +297,6 @@ static int ocfb_probe(struct platform_device *pdev)
 {
 	int ret = 0;
 	struct ocfb_dev *fbdev;
-	struct resource *res;
 	int fbsize;

 	fbdev = devm_kzalloc(&pdev->dev, sizeof(*fbdev), GFP_KERNEL);
@@ -319,13 +318,7 @@ static int ocfb_probe(struct platform_device *pdev)
 	ocfb_init_var(fbdev);
 	ocfb_init_fix(fbdev);

-	/* Request I/O resource */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "I/O resource request failed\n");
-		return -ENXIO;
-	}
-	fbdev->regs = devm_ioremap_resource(&pdev->dev, res);
+	fbdev->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(fbdev->regs))
 		return PTR_ERR(fbdev->regs);

--
2.23.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe()
  2019-09-19 14:33 ` [PATCH] video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe() Markus Elfring
@ 2020-01-03 12:33   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-03 12:33 UTC (permalink / raw)
  To: Markus Elfring
  Cc: linux-fbdev, dri-devel, LKML, kernel-janitors,
	Bartosz Golaszewski, Himanshu Jha


On 9/19/19 4:33 PM, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 19 Sep 2019 16:26:56 +0200
> 
> Simplify this function implementation by using a known wrapper function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

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/ocfb.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/video/fbdev/ocfb.c b/drivers/video/fbdev/ocfb.c
> index a970edc2a6f8..be308b4dc91d 100644
> --- a/drivers/video/fbdev/ocfb.c
> +++ b/drivers/video/fbdev/ocfb.c
> @@ -297,7 +297,6 @@ static int ocfb_probe(struct platform_device *pdev)
>  {
>  	int ret = 0;
>  	struct ocfb_dev *fbdev;
> -	struct resource *res;
>  	int fbsize;
> 
>  	fbdev = devm_kzalloc(&pdev->dev, sizeof(*fbdev), GFP_KERNEL);
> @@ -319,13 +318,7 @@ static int ocfb_probe(struct platform_device *pdev)
>  	ocfb_init_var(fbdev);
>  	ocfb_init_fix(fbdev);
> 
> -	/* Request I/O resource */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(&pdev->dev, "I/O resource request failed\n");
> -		return -ENXIO;
> -	}
> -	fbdev->regs = devm_ioremap_resource(&pdev->dev, res);
> +	fbdev->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(fbdev->regs))
>  		return PTR_ERR(fbdev->regs);
> 
> --
> 2.23.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-03 12:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190919143339epcas5p2ca00bc034be8e478353a40475683de13@epcas5p2.samsung.com>
2019-09-19 14:33 ` [PATCH] video: ocfb: Use devm_platform_ioremap_resource() in ocfb_probe() Markus Elfring
2020-01-03 12:33   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®