From: Fabio Estevam <festevam@gmail.com>
To: l.stach@pengutronix.de
Cc: dri-devel@lists.freedesktop.org, laurentiu.palcu@oss.nxp.com
Subject: [PATCH] drm/imx/dcss: Use device_get_match_data()
Date: Mon, 15 Mar 2021 09:38:11 -0300 [thread overview]
Message-ID: <20210315123811.159205-1-festevam@gmail.com> (raw)
The retrieval of driver data can be a bit simplified by using
device_get_match_data(), so switch to it.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/gpu/drm/imx/dcss/dcss-dev.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index c849533ca83e..de0f02de94c4 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -168,13 +168,6 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
int ret;
struct resource *res;
struct dcss_dev *dcss;
- const struct dcss_type_data *devtype;
-
- devtype = of_device_get_match_data(dev);
- if (!devtype) {
- dev_err(dev, "no device match found\n");
- return ERR_PTR(-ENODEV);
- }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -187,7 +180,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
return ERR_PTR(-ENOMEM);
dcss->dev = dev;
- dcss->devtype = devtype;
+ dcss->devtype = device_get_match_data(dev);
dcss->hdmi_output = hdmi_output;
ret = dcss_clks_init(dcss);
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2021-03-15 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 12:38 Fabio Estevam [this message]
2021-03-22 8:48 ` [PATCH] drm/imx/dcss: Use device_get_match_data() Laurentiu Palcu
2021-03-22 9:24 ` Ying Liu
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=20210315123811.159205-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=laurentiu.palcu@oss.nxp.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