diff mbox

[v2,14/30] drm: omapdrm: dss: Don't unnecessarily cast to dev to pdev and back

Message ID 20180213120048.21603-15-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Feb. 13, 2018, noon UTC
The dss_unbind() function casts the struct device pointer to a struct
platform_device, only to later use the struct device pointer from
platform_device. Don't cast at all.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sebastian Reichel Feb. 13, 2018, 8:23 p.m. UTC | #1
Hi,

On Tue, Feb 13, 2018 at 02:00:32PM +0200, Laurent Pinchart wrote:
> The dss_unbind() function casts the struct device pointer to a struct
> platform_device, only to later use the struct device pointer from
> platform_device. Don't cast at all.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

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

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dss.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
> index 7a5f5f233ad0..14d2f024eb70 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -1332,11 +1332,9 @@ static int dss_bind(struct device *dev)
>  
>  static void dss_unbind(struct device *dev)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -
>  	omapdss_set_is_initialized(false);
>  
> -	component_unbind_all(&pdev->dev, NULL);
> +	component_unbind_all(dev, NULL);
>  }
>  
>  static const struct component_master_ops dss_component_ops = {
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 7a5f5f233ad0..14d2f024eb70 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1332,11 +1332,9 @@  static int dss_bind(struct device *dev)
 
 static void dss_unbind(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-
 	omapdss_set_is_initialized(false);
 
-	component_unbind_all(&pdev->dev, NULL);
+	component_unbind_all(dev, NULL);
 }
 
 static const struct component_master_ops dss_component_ops = {