linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-07  7:42 Cai Huoqing
  2021-09-08  2:22 ` Samuel Holland
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-07  7:42 UTC (permalink / raw)
  To: caihuoqing
  Cc: Jassi Brar, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	linux-kernel, linux-arm-kernel, linux-sunxi

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>
---
 drivers/mailbox/sun6i-msgbox.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/mailbox/sun6i-msgbox.c b/drivers/mailbox/sun6i-msgbox.c
index ccecf2e5941d..7f8d931042d3 100644
--- a/drivers/mailbox/sun6i-msgbox.c
+++ b/drivers/mailbox/sun6i-msgbox.c
@@ -197,7 +197,6 @@ static int sun6i_msgbox_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct mbox_chan *chans;
 	struct reset_control *reset;
-	struct resource *res;
 	struct sun6i_msgbox *mbox;
 	int i, ret;
 
@@ -246,13 +245,7 @@ static int sun6i_msgbox_probe(struct platform_device *pdev)
 		goto err_disable_unprepare;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		ret = -ENODEV;
-		goto err_disable_unprepare;
-	}
-
-	mbox->regs = devm_ioremap_resource(&pdev->dev, res);
+	mbox->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mbox->regs)) {
 		ret = PTR_ERR(mbox->regs);
 		dev_err(dev, "Failed to map MMIO resource: %d\n", ret);
-- 
2.25.1


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

* Re: [PATCH] mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-07  7:42 [PATCH] mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08  2:22 ` Samuel Holland
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Holland @ 2021-09-08  2:22 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Jassi Brar, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	linux-kernel, linux-arm-kernel, linux-sunxi

On 9/7/21 2:42 AM, Cai Huoqing wrote:
> 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>
> ---
>  drivers/mailbox/sun6i-msgbox.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Reviewed-by: Samuel Holland <samuel@sholland.org>

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

end of thread, other threads:[~2021-09-08  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  7:42 [PATCH] mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08  2:22 ` Samuel Holland

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).