[PATCH v2 37/60] drm/omap: displays: Don't cast dssdev to panel data unnecessarily

Sebastian Reichel sre at kernel.org
Sun Jun 10 21:14:06 UTC 2018


Hi,

On Sat, May 26, 2018 at 08:24:55PM +0300, Laurent Pinchart wrote:
> 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 at ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.co.uk>

-- Sebastian

>  drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 5 ++---
>  drivers/gpu/drm/omapdrm/displays/connector-hdmi.c      | 5 ++---
>  2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> index 4f32c8ddcfbd..eab898b5bf0f 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
> @@ -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;
>  	}
>  
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> index b3f88ab0cd6e..cf06b47d6ce7 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> @@ -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;
>  	}
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180610/137444d2/attachment.sig>


More information about the dri-devel mailing list