linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe()
@ 2019-09-18  6:34 Markus Elfring
  2019-10-04 19:44 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-18  6:34 UTC (permalink / raw)
  To: linux-ide, Jens Axboe, Linus Walleij
  Cc: LKML, kernel-janitors, Bartosz Golaszewski, Himanshu Jha

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 18 Sep 2019 08:28:09 +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/ata/sata_gemini.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/ata/sata_gemini.c b/drivers/ata/sata_gemini.c
index f793564f3d78..61a34cad90c1 100644
--- a/drivers/ata/sata_gemini.c
+++ b/drivers/ata/sata_gemini.c
@@ -318,7 +318,6 @@ static int gemini_sata_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	struct sata_gemini *sg;
 	struct regmap *map;
-	struct resource *res;
 	enum gemini_muxmode muxmode;
 	u32 gmode;
 	u32 gmask;
@@ -328,12 +327,7 @@ static int gemini_sata_probe(struct platform_device *pdev)
 	if (!sg)
 		return -ENOMEM;
 	sg->dev = dev;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-
-	sg->base = devm_ioremap_resource(dev, res);
+	sg->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(sg->base))
 		return PTR_ERR(sg->base);

--
2.23.0



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

* Re: [PATCH] sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe()
  2019-09-18  6:34 [PATCH] sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe() Markus Elfring
@ 2019-10-04 19:44 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2019-10-04 19:44 UTC (permalink / raw)
  To: Markus Elfring
  Cc: linux-ide, Jens Axboe, LKML, kernel-janitors,
	Bartosz Golaszewski, Himanshu Jha

On Wed, Sep 18, 2019 at 8:34 AM Markus Elfring <Markus.Elfring@web.de> wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 18 Sep 2019 08:28:09 +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>

Looks correct.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2019-10-04 19:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18  6:34 [PATCH] sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe() Markus Elfring
2019-10-04 19:44 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).