* [PATCH] pinctrl: Make use of the helper function devm_platform_ioremap_resource()
@ 2022-04-18 2:02 cgel.zte
2022-04-21 14:36 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-18 2:02 UTC (permalink / raw)
To: lakshmi.sowjanya.d, linus.walleij
Cc: linux-gpio, linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately.Make the
code simpler without functional changes.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/pinctrl/pinctrl-thunderbay.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-thunderbay.c b/drivers/pinctrl/pinctrl-thunderbay.c
index 79d44bca039e..9328b17485cf 100644
--- a/drivers/pinctrl/pinctrl-thunderbay.c
+++ b/drivers/pinctrl/pinctrl-thunderbay.c
@@ -1229,7 +1229,6 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev)
const struct of_device_id *of_id;
struct device *dev = &pdev->dev;
struct thunderbay_pinctrl *tpc;
- struct resource *iomem;
int ret;
of_id = of_match_node(thunderbay_pinctrl_match, pdev->dev.of_node);
@@ -1243,11 +1242,7 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev)
tpc->dev = dev;
tpc->soc = of_id->data;
- iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!iomem)
- return -ENXIO;
-
- tpc->base0 = devm_ioremap_resource(dev, iomem);
+ tpc->base0 = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(tpc->base0))
return PTR_ERR(tpc->base0);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: Make use of the helper function devm_platform_ioremap_resource()
2022-04-18 2:02 [PATCH] pinctrl: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
@ 2022-04-21 14:36 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-04-21 14:36 UTC (permalink / raw)
To: cgel.zte
Cc: lakshmi.sowjanya.d, linux-gpio, linux-kernel, Lv Ruyi, Zeal Robot
On Mon, Apr 18, 2022 at 4:02 AM <cgel.zte@gmail.com> wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-21 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-18 2:02 [PATCH] pinctrl: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
2022-04-21 14:36 ` 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).