drm/omap: displays: Don't cast dssdev to panel data unnecessarily
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 2 Mar 2018 20:05:41 +0000 (22:05 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:27 +0000 (16:13 +0300)
The connect handle of the analog TV and HDMI connectors casts the dssdev
to panel data only to then access fields of the panel data that are also
present in the dssdev. Remove the cast and use dssdev directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c

index 15921b361672d35562a6ffcc0005396c9496d738..cda6c312ad052cb0315465bc4371faa99c486e6d 100644 (file)
@@ -43,13 +43,12 @@ static const struct videomode tvc_pal_vm = {
 
 static int tvc_connect(struct omap_dss_device *dssdev)
 {
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
        struct omap_dss_device *src;
        int r;
 
-       src = omapdss_of_find_connected_device(ddata->dev->of_node, 0);
+       src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
        if (IS_ERR_OR_NULL(src)) {
-               dev_err(ddata->dev, "failed to find video source\n");
+               dev_err(dssdev->dev, "failed to find video source\n");
                return src ? PTR_ERR(src) : -EINVAL;
        }
 
index 3452925ed54db748a7788d78ecf8e819da5f2c2f..6eb4c24d6aa7978fcda4b22cbe5e983aa0e45b64 100644 (file)
@@ -53,13 +53,12 @@ struct panel_drv_data {
 
 static int hdmic_connect(struct omap_dss_device *dssdev)
 {
-       struct panel_drv_data *ddata = to_panel_data(dssdev);
        struct omap_dss_device *src;
        int r;
 
-       src = omapdss_of_find_connected_device(ddata->dev->of_node, 0);
+       src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
        if (IS_ERR_OR_NULL(src)) {
-               dev_err(ddata->dev, "failed to find video source\n");
+               dev_err(dssdev->dev, "failed to find video source\n");
                return src ? PTR_ERR(src) : -EINVAL;
        }