drm/imx/dcss: Use device_get_match_data()
Subsystems (4)
Fabio Estevam
reviewerPATCH 1/1 drm/imx/dcss: Use device_get_match_data()
The retrieval of driver data can be a bit simplified by using device_get_match_data(), so switch to it.
--- drivers/gpu/drm/imx/dcss/dcss-dev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/gpu/drm/imx/dcss/dcss-dev.c +1 -8
@@ -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);
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Fabio,
Quoted 4 lines · Fabio Estevam
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 <[email protected]>
Quoted 34 lines
--- drivers/gpu/drm/imx/dcss/dcss-dev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/gpu/drm/imx/dcss/dcss-dev.c +1
-8@@ -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);Signature · 1 line
2.17.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Fabio,
Quoted 14 lines · Fabio Estevam
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 <[email protected]>--- drivers/gpu/drm/imx/dcss/dcss-dev.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)drivers/gpu/drm/imx/dcss/dcss-dev.c +0
-0
drivers/gpu/drm/imx/dcss/dcss-dev.c struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) · line 173
Quoted 6 lines
drivers/gpu/drm/imx/dcss/dcss-dev.c +0
-3@@ -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
Quoted 19 lines
drivers/gpu/drm/imx/dcss/dcss-dev.c +1
-6-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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel