From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Rob Herring (Arm)" <robh@kernel.org>,
Javier Martinez Canillas <javierm@redhat.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Thierry Reding <treding@nvidia.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/simpledrm: Use of_reserved_mem_region_to_resource() for "memory-region"
Date: Fri, 4 Jul 2025 09:15:01 +0200 [thread overview]
Message-ID: <cc25c6b6-92df-446f-a63f-4512d72bfc50@suse.de> (raw)
In-Reply-To: <20250703183447.2073902-1-robh@kernel.org>
cc'ing Thierry
Hi,
thanks for the patch.
Am 03.07.25 um 20:34 schrieb Rob Herring (Arm):
> Use the newly added of_reserved_mem_region_to_resource() function to
> handle "memory-region" properties.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
as far as the code is concerned. Might need a review from Thierry, who
added the functionality in the first place.
Best regards
Thomas
> ---
> drivers/gpu/drm/sysfb/simpledrm.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
> index a1c3119330de..c8856e6645e2 100644
> --- a/drivers/gpu/drm/sysfb/simpledrm.c
> +++ b/drivers/gpu/drm/sysfb/simpledrm.c
> @@ -4,7 +4,7 @@
> #include <linux/clk.h>
> #include <linux/of_clk.h>
> #include <linux/minmax.h>
> -#include <linux/of_address.h>
> +#include <linux/of_reserved_mem.h>
> #include <linux/platform_data/simplefb.h>
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> @@ -180,22 +180,17 @@ simplefb_get_format_of(struct drm_device *dev, struct device_node *of_node)
> static struct resource *
> simplefb_get_memory_of(struct drm_device *dev, struct device_node *of_node)
> {
> - struct device_node *np;
> - struct resource *res;
> + struct resource r, *res;
> int err;
>
> - np = of_parse_phandle(of_node, "memory-region", 0);
> - if (!np)
> + err = of_reserved_mem_region_to_resource(of_node, 0, &r);
> + if (err)
> return NULL;
>
> - res = devm_kzalloc(dev->dev, sizeof(*res), GFP_KERNEL);
> + res = devm_kmemdup(dev->dev, &r, sizeof(r), GFP_KERNEL);
> if (!res)
> return ERR_PTR(-ENOMEM);
>
> - err = of_address_to_resource(np, 0, res);
> - if (err)
> - return ERR_PTR(err);
> -
> if (of_property_present(of_node, "reg"))
> drm_warn(dev, "preferring \"memory-region\" over \"reg\" property\n");
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
next prev parent reply other threads:[~2025-07-04 7:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 18:34 [PATCH] drm/simpledrm: Use of_reserved_mem_region_to_resource() for "memory-region" Rob Herring (Arm)
2025-07-04 7:15 ` Thomas Zimmermann [this message]
2025-07-04 7:24 ` Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc25c6b6-92df-446f-a63f-4512d72bfc50@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=treding@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).