[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ieknc4dm5ntnqaqz6zdlinphocm2omsn4ll34vlbrohqcddl43@kg35irldnkuw>
Date: Wed, 29 Jan 2025 16:40:41 +0100
From: Maxime Ripard <mripard@...nel.org>
To: Anusha Srivatsa <asrivats@...hat.com>
Cc: Joel Stanley <joel@....id.au>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Andrew Jeffery <andrew@...econstruct.com.au>, Stefan Agner <stefan@...er.ch>,
Alison Wang <alison.wang@....com>, Xinliang Liu <xinliang.liu@...aro.org>,
Tian Tao <tiantao6@...ilicon.com>, Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Sumit Semwal <sumit.semwal@...aro.org>, Yongqin Liu <yongqin.liu@...aro.org>,
John Stultz <jstultz@...gle.com>, Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, Neil Armstrong <neil.armstrong@...aro.org>,
Kevin Hilman <khilman@...libre.com>, Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>, Marek Vasut <marex@...x.de>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Sandy Huang <hjc@...k-chips.com>,
Heiko Stübner <heiko@...ech.de>, Andy Yan <andy.yan@...k-chips.com>,
Orson Zhai <orsonzhai@...il.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>,
Chunyan Zhang <zhang.lyra@...il.com>, Alain Volmat <alain.volmat@...s.st.com>,
Raphael Gallais-Pou <rgallaispou@...il.com>, Yannick Fertre <yannick.fertre@...s.st.com>,
Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>, Philippe Cornu <philippe.cornu@...s.st.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>, Alexandre Torgue <alexandre.torgue@...s.st.com>,
Thierry Reding <thierry.reding@...il.com>, Mikko Perttunen <mperttunen@...dia.com>,
Jonathan Hunter <jonathanh@...dia.com>, Alexey Brodkin <abrodkin@...opsys.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>, Maíra Canal <mcanal@...lia.com>,
Raspberry Pi Kernel Maintenance <kernel-list@...pberrypi.com>, Jonathan Corbet <corbet@....net>, linux-aspeed@...ts.ozlabs.org,
dri-devel@...ts.freedesktop.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, imx@...ts.linux.dev, linux-rockchip@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com, linux-tegra@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH 05/14] drm/meson: move to
devm_platform_ioremap_resource() usage
On Tue, Jan 28, 2025 at 05:29:29PM -0500, Anusha Srivatsa wrote:
> Replace platform_get_resource_byname + devm_ioremap
> with just devm_platform_ioremap_resource()
>
> Used Coccinelle to do this change. SmPl patch:
> @rule_3@
> identifier res;
> expression ioremap;
> identifier pdev;
> constant mem;
> expression name;
> @@
> -struct resource *res;
> ...
> -res = platform_get_resource_byname(pdev,mem,name);
> <...
> -if (!res) {
> -...
> -}
> ...>
> -ioremap = devm_ioremap(...);
> +ioremap = devm_platform_ioremap_resource_byname(pdev,name);
>
> Cc: Neil Armstrong <neil.armstrong@...aro.org>
> Signed-off-by: Anusha Srivatsa <asrivats@...hat.com>
> ---
> drivers/gpu/drm/meson/meson_drv.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
> index 81d2ee37e7732dca89d02347b9c972300b38771a..6c805805b7a7f675f8bb03944318972eb4df864e 100644
> --- a/drivers/gpu/drm/meson/meson_drv.c
> +++ b/drivers/gpu/drm/meson/meson_drv.c
> @@ -184,7 +184,6 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
> const struct meson_drm_match_data *match;
> struct meson_drm *priv;
> struct drm_device *drm;
> - struct resource *res;
> void __iomem *regs;
> int ret, i;
>
> @@ -220,14 +219,8 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
> }
>
> priv->io_base = regs;
> -
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi");
> - if (!res) {
> - ret = -EINVAL;
> - goto free_drm;
> - }
> /* Simply ioremap since it may be a shared register zone */
> - regs = devm_ioremap(dev, res->start, resource_size(res));
> + regs = devm_platform_ioremap_resource_byname(pdev, "hhi");
Given the comment, this one should probably be skipped.
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (274 bytes)
Powered by blists - more mailing lists