mailbox: xgene-slimpro: Make use of the helper function devm_platform_ioremap_resource()
authorCai Huoqing <caihuoqing@baidu.com>
Tue, 7 Sep 2021 07:42:15 +0000 (15:42 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Sat, 16 Oct 2021 19:39:49 +0000 (14:39 -0500)
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mailbox-xgene-slimpro.c

index 5b3a2dcd595534c6b7fbed11595b2784c8b07396..946ea773ec33ad8a0f3a690ed302d20c4fcc51ec 100644 (file)
@@ -170,7 +170,6 @@ static const struct mbox_chan_ops slimpro_mbox_ops = {
 static int slimpro_mbox_probe(struct platform_device *pdev)
 {
        struct slimpro_mbox *ctx;
-       struct resource *regs;
        void __iomem *mb_base;
        int rc;
        int i;
@@ -181,8 +180,7 @@ static int slimpro_mbox_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ctx);
 
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mb_base = devm_ioremap_resource(&pdev->dev, regs);
+       mb_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mb_base))
                return PTR_ERR(mb_base);