From: Thierry Reding <thierry.reding@gmail.com>
To: Heiko Stuebner <heiko@sntech.de>, Lin Huang <hl@rock-chips.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/panel: innolux-p079zca: Use of_device_get_match_data()
Date: Tue, 10 Jul 2018 16:24:37 +0200 [thread overview]
Message-ID: <20180710142437.GD13242@ulmo> (raw)
In-Reply-To: <20180710110127.12315-1-thierry.reding@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1409 bytes --]
On Tue, Jul 10, 2018 at 01:01:27PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Use this helper to get rid of some extra boilerplate code.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/drm/panel/panel-innolux-p079zca.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 185a55060195..62fbaac96823 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -314,14 +314,9 @@ static void innolux_panel_del(struct innolux_panel *innolux)
> static int innolux_panel_probe(struct mipi_dsi_device *dsi)
> {
> const struct panel_desc *desc;
> - const struct of_device_id *id;
> int err;
>
> - id = of_match_node(innolux_of_match, dsi->dev.of_node);
> - if (!id)
> - return -ENODEV;
> -
> - desc = id->data;
> + desc = of_device_get_match_data(dsi->dev);
> dsi->mode_flags = desc->flags;
> dsi->format = desc->format;
> dsi->lanes = desc->lanes;
Oops, I just noticed I had parts of this in a stash which causes the
above to fail to build. I've squashed the missing bits into the above,
adding an include for linux/of_device.h and passing &dsi->dev instead
of dsi->dev to of_device_get_match_data().
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2018-07-10 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 11:01 [PATCH] drm/panel: innolux-p079zca: Use of_device_get_match_data() Thierry Reding
2018-07-10 12:41 ` Heiko Stuebner
2018-07-10 14:21 ` Thierry Reding
2018-07-10 14:24 ` Thierry Reding [this message]
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=20180710142437.GD13242@ulmo \
--to=thierry.reding@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hl@rock-chips.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).