sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe()
PATCH 1/1 sata_gemini: Use devm_platform_ioremap_resource() in gemini_sata_probe()
From: Markus Elfring <[email protected]>
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 <[email protected]>
--- drivers/ata/sata_gemini.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/ata/sata_gemini.c +1 -7
@@ -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
Quoted 8 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Wed, 18 Sep 2019 08:28:09 +0200Simplify this function implementation by using a known wrapper function.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
Looks correct.
Reviewed-by Linus Walleij <[email protected]>
Yours,
Linus Walleij