From: Paul Cercueil <paul@crapouillou.net>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
od@zcrc.me, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] DRM: ingenic: Use devm_platform_ioremap_resource
Date: Sun, 30 Jun 2019 13:09:09 +0200 [thread overview]
Message-ID: <1561892949.1773.0@crapouillou.net> (raw)
In-Reply-To: <20190630081833.GC5081@ravnborg.org>
Le dim. 30 juin 2019 à 10:18, Sam Ravnborg <sam@ravnborg.org> a écrit
:
> Hi Paul.
>
> On Thu, Jun 27, 2019 at 08:21:12PM +0200, Paul Cercueil wrote:
>> Simplify a bit the probe function by using the newly introduced
>> devm_platform_ioremap_resource(), instead of having to call
>> platform_get_resource() followed by devm_ioremap_resource().
>>
>> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>> ---
>> drivers/gpu/drm/ingenic/ingenic-drm.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c
>> b/drivers/gpu/drm/ingenic/ingenic-drm.c
>> index a069579ca749..02c4788ef1c7 100644
>> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
>> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
>> @@ -580,7 +580,6 @@ static int ingenic_drm_probe(struct
>> platform_device *pdev)
>> struct drm_bridge *bridge;
>> struct drm_panel *panel;
>> struct drm_device *drm;
>> - struct resource *mem;
>> void __iomem *base;
>> long parent_rate;
>> int ret, irq;
>> @@ -614,8 +613,7 @@ static int ingenic_drm_probe(struct
>> platform_device *pdev)
>> drm->mode_config.max_height = 600;
>> drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
>>
>> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - base = devm_ioremap_resource(dev, mem);
>> + base = devm_platform_ioremap_resource(pdev, 0);
>> if (IS_ERR(base)) {
>> dev_err(dev, "Failed to get memory resource");
> Consider to include the error code in the error message here.
I don't think it's needed; a non-zero error code in the probe function
will
have the drivers core automatically print a message with the name of the
failing driver and the return code.
>> return PTR_ERR(base);
>
> With the above fixed/considered:
> Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
next prev parent reply other threads:[~2019-06-30 11:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 18:21 [PATCH 1/3] DRM: ingenic: Use devm_platform_ioremap_resource Paul Cercueil
2019-06-27 18:21 ` [PATCH 2/3] DRM: ingenic: Add support for Sharp panels Paul Cercueil
2019-06-30 8:20 ` Sam Ravnborg
2019-06-27 18:21 ` [PATCH 3/3] DRM: ingenic: Add support for panels with 8-bit serial bus Paul Cercueil
2019-06-30 8:21 ` Sam Ravnborg
2019-06-30 8:18 ` [PATCH 1/3] DRM: ingenic: Use devm_platform_ioremap_resource Sam Ravnborg
2019-06-30 11:09 ` Paul Cercueil [this message]
2019-06-30 20:56 ` Sam Ravnborg
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=1561892949.1773.0@crapouillou.net \
--to=paul@crapouillou.net \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=od@zcrc.me \
--cc=sam@ravnborg.org \
/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