* [PATCH] drm/imx/dcss: Use device_get_match_data()
@ 2021-03-15 12:38 Fabio Estevam
2021-03-22 8:48 ` Laurentiu Palcu
2021-03-22 9:24 ` Ying Liu
0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2021-03-15 12:38 UTC (permalink / raw)
To: l.stach; +Cc: dri-devel, laurentiu.palcu
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/imx/dcss: Use device_get_match_data()
2021-03-15 12:38 [PATCH] drm/imx/dcss: Use device_get_match_data() Fabio Estevam
@ 2021-03-22 8:48 ` Laurentiu Palcu
2021-03-22 9:24 ` Ying Liu
1 sibling, 0 replies; 3+ messages in thread
From: Laurentiu Palcu @ 2021-03-22 8:48 UTC (permalink / raw)
To: Fabio Estevam; +Cc: dri-devel
Hi Fabio,
On Mon, Mar 15, 2021 at 09:38:11AM -0300, Fabio Estevam wrote:
> 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>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/imx/dcss: Use device_get_match_data()
2021-03-15 12:38 [PATCH] drm/imx/dcss: Use device_get_match_data() Fabio Estevam
2021-03-22 8:48 ` Laurentiu Palcu
@ 2021-03-22 9:24 ` Ying Liu
1 sibling, 0 replies; 3+ messages in thread
From: Ying Liu @ 2021-03-22 9:24 UTC (permalink / raw)
To: Fabio Estevam; +Cc: laurentiu.palcu, DRI Development
Hi Fabio,
On Mon, Mar 15, 2021 at 8:38 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> 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);
It looks like this is the only user of linux/of_device.h in this file?
If so, remove linux/of_device.h and include linux/platform_device.h?
Regards,
Liu Ying
> - 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-22 9:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 12:38 [PATCH] drm/imx/dcss: Use device_get_match_data() Fabio Estevam
2021-03-22 8:48 ` Laurentiu Palcu
2021-03-22 9:24 ` Ying Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.