* [PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname()
@ 2023-08-01 8:32 Li Zetao
2023-08-01 21:47 ` Laurent Pinchart
0 siblings, 1 reply; 2+ messages in thread
From: Li Zetao @ 2023-08-01 8:32 UTC (permalink / raw)
To: laurent.pinchart, airlied, daniel, michal.simek
Cc: lizetao1, dri-devel, linux-arm-kernel
Convert platform_get_resource_byname() + devm_ioremap_resource() to a
single call to devm_platform_ioremap_resource_byname(), as this is
exactly what this function does.
Signed-off-by: Li Zetao <lizetao1@huawei.com>
---
drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
index 3b87eebddc97..2b731f3eea54 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
@@ -1228,7 +1228,6 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
{
struct platform_device *pdev = to_platform_device(dpsub->dev);
struct zynqmp_disp *disp;
- struct resource *res;
int ret;
disp = kzalloc(sizeof(*disp), GFP_KERNEL);
@@ -1238,22 +1237,19 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
disp->dev = &pdev->dev;
disp->dpsub = dpsub;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "blend");
- disp->blend.base = devm_ioremap_resource(disp->dev, res);
+ disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend");
if (IS_ERR(disp->blend.base)) {
ret = PTR_ERR(disp->blend.base);
goto error;
}
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "av_buf");
- disp->avbuf.base = devm_ioremap_resource(disp->dev, res);
+ disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf");
if (IS_ERR(disp->avbuf.base)) {
ret = PTR_ERR(disp->avbuf.base);
goto error;
}
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aud");
- disp->audio.base = devm_ioremap_resource(disp->dev, res);
+ disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud");
if (IS_ERR(disp->audio.base)) {
ret = PTR_ERR(disp->audio.base);
goto error;
--
2.34.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] 2+ messages in thread
* Re: [PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname()
2023-08-01 8:32 [PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname() Li Zetao
@ 2023-08-01 21:47 ` Laurent Pinchart
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2023-08-01 21:47 UTC (permalink / raw)
To: Li Zetao; +Cc: airlied, daniel, michal.simek, dri-devel, linux-arm-kernel
Hi Li,
Thank you for the patch.
On Tue, Aug 01, 2023 at 04:32:20PM +0800, Li Zetao wrote:
> Convert platform_get_resource_byname() + devm_ioremap_resource() to a
> single call to devm_platform_ioremap_resource_byname(), as this is
> exactly what this function does.
>
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> index 3b87eebddc97..2b731f3eea54 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> @@ -1228,7 +1228,6 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
> {
> struct platform_device *pdev = to_platform_device(dpsub->dev);
> struct zynqmp_disp *disp;
> - struct resource *res;
> int ret;
>
> disp = kzalloc(sizeof(*disp), GFP_KERNEL);
> @@ -1238,22 +1237,19 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
> disp->dev = &pdev->dev;
> disp->dpsub = dpsub;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "blend");
> - disp->blend.base = devm_ioremap_resource(disp->dev, res);
> + disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend");
> if (IS_ERR(disp->blend.base)) {
> ret = PTR_ERR(disp->blend.base);
> goto error;
> }
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "av_buf");
> - disp->avbuf.base = devm_ioremap_resource(disp->dev, res);
> + disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf");
> if (IS_ERR(disp->avbuf.base)) {
> ret = PTR_ERR(disp->avbuf.base);
> goto error;
> }
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "aud");
> - disp->audio.base = devm_ioremap_resource(disp->dev, res);
> + disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud");
> if (IS_ERR(disp->audio.base)) {
> ret = PTR_ERR(disp->audio.base);
> goto error;
--
Regards,
Laurent Pinchart
_______________________________________________
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] 2+ messages in thread
end of thread, other threads:[~2023-08-01 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 8:32 [PATCH -next] drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname() Li Zetao
2023-08-01 21:47 ` Laurent Pinchart
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).