linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource()
@ 2023-01-19  9:15 ye.xingchen
  2023-01-20  2:09 ` Andrew Jeffery
  2023-01-20  9:29 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: ye.xingchen @ 2023-01-19  9:15 UTC (permalink / raw)
  To: brendan.higgins
  Cc: benh, joel, andrew, linux-i2c, openbmc, linux-arm-kernel,
	linux-aspeed, linux-kernel

From: ye xingchen <ye.xingchen@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/i2c/busses/i2c-aspeed.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index c64c381b69b7..d3c99c5b3247 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -979,15 +979,13 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
 	const struct of_device_id *match;
 	struct aspeed_i2c_bus *bus;
 	struct clk *parent_clk;
-	struct resource *res;
 	int irq, ret;

 	bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL);
 	if (!bus)
 		return -ENOMEM;

-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	bus->base = devm_ioremap_resource(&pdev->dev, res);
+	bus->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(bus->base))
 		return PTR_ERR(bus->base);

-- 
2.25.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource()
  2023-01-19  9:15 [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource() ye.xingchen
@ 2023-01-20  2:09 ` Andrew Jeffery
  2023-01-20  9:29 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Jeffery @ 2023-01-20  2:09 UTC (permalink / raw)
  To: ye.xingchen, brendan.higgins
  Cc: Benjamin Herrenschmidt, Joel Stanley, linux-i2c, openbmc,
	linux-arm-kernel, linux-aspeed, linux-kernel



On Thu, 19 Jan 2023, at 19:45, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: Andrew Jeffery <andrew@aj.id.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource()
  2023-01-19  9:15 [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource() ye.xingchen
  2023-01-20  2:09 ` Andrew Jeffery
@ 2023-01-20  9:29 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-01-20  9:29 UTC (permalink / raw)
  To: ye.xingchen
  Cc: brendan.higgins, benh, joel, andrew, linux-i2c, openbmc,
	linux-arm-kernel, linux-aspeed, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 388 bytes --]

On Thu, Jan 19, 2023 at 05:15:31PM +0800, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Applied to for-next, thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-20  9:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-19  9:15 [PATCH] i2c: aspeed: Use devm_platform_get_and_ioremap_resource() ye.xingchen
2023-01-20  2:09 ` Andrew Jeffery
2023-01-20  9:29 ` Wolfram Sang

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