[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <daa6bcaf1e612f667c5d5d26b9d515f43985b595.camel@codeconstruct.com.au>
Date: Thu, 30 Jan 2025 16:02:00 +1030
From: Andrew Jeffery <andrew@...econstruct.com.au>
To: oushixiong1025@....com, Joel Stanley <joel@....id.au>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
<airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
linux-aspeed@...ts.ozlabs.org, dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, Dmitry
Baryshkov <dmitry.baryshkov@...aro.org>, Shixiong Ou <oushixiong@...inos.cn>
Subject: Re: [PATCH v2] drm/aspeed: Use
devm_platform_get_and_ioremap_resource()
On Wed, 2025-01-22 at 11:01 +0800, oushixiong1025@....com wrote:
> From: Shixiong Ou <oushixiong@...inos.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@...inos.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
Powered by blists - more mailing lists