Skip to content

Commit

Permalink
drm/omap: displays: Don't cast dssdev to panel data unnecessarily
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laurent Pinchart authored and Tomi Valkeinen committed Sep 3, 2018
1 parent eaaedaf commit a25edf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a25edf0

Please sign in to comment.