* [PATCH v2] drm/aspeed: Use devm_platform_get_and_ioremap_resource()
@ 2025-01-22 3:01 oushixiong1025
2025-01-30 5:32 ` Andrew Jeffery
0 siblings, 1 reply; 2+ messages in thread
From: oushixiong1025 @ 2025-01-22 3:01 UTC (permalink / raw)
To: Joel Stanley
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Andrew Jeffery, linux-aspeed,
dri-devel, linux-arm-kernel, linux-kernel, Dmitry Baryshkov,
Shixiong Ou
From: Shixiong Ou <oushixiong@kylinos.cn>
Convert platform_get_resource(), devm_ioremap_resource() to a single call to
devm_platform_get_and_ioremap_resource().
Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
---
V1 -> V2: Add Missing commit message.
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index a7a6b70220eb..33f81b53771d 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -146,8 +146,7 @@ static int aspeed_gfx_load(struct drm_device *drm)
struct resource *res;
int ret;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(drm->dev, res);
+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] drm/aspeed: Use devm_platform_get_and_ioremap_resource()
2025-01-22 3:01 [PATCH v2] drm/aspeed: Use devm_platform_get_and_ioremap_resource() oushixiong1025
@ 2025-01-30 5:32 ` Andrew Jeffery
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Jeffery @ 2025-01-30 5:32 UTC (permalink / raw)
To: oushixiong1025, Joel Stanley
Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, linux-aspeed, dri-devel,
linux-arm-kernel, linux-kernel, Dmitry Baryshkov, Shixiong Ou
On Wed, 2025-01-22 at 11:01 +0800, oushixiong1025@163.com wrote:
> From: Shixiong Ou <oushixiong@kylinos.cn>
>
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to
> devm_platform_get_and_ioremap_resource().
>
> Signed-off-by: Shixiong Ou <oushixiong@kylinos.cn>
> ---
> V1 -> V2: Add Missing commit message.
>
> drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> index a7a6b70220eb..33f81b53771d 100644
> --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
> @@ -146,8 +146,7 @@ static int aspeed_gfx_load(struct drm_device
> *drm)
> struct resource *res;
> int ret;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - priv->base = devm_ioremap_resource(drm->dev, res);
> + priv->base = devm_platform_get_and_ioremap_resource(pdev, 0,
> &res);
> if (IS_ERR(priv->base))
> return PTR_ERR(priv->base);
>
I think I prefer this one:
https://lore.kernel.org/all/20250128-cocci-memory-api-v1-1-0d1609a29587@redhat.com/
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-30 5:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-22 3:01 [PATCH v2] drm/aspeed: Use devm_platform_get_and_ioremap_resource() oushixiong1025
2025-01-30 5:32 ` Andrew Jeffery
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®