drm: omapdrm: dss: Don't unnecessarily cast to dev to pdev and back
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 13 Feb 2018 12:00:32 +0000 (14:00 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 1 Mar 2018 07:18:18 +0000 (09:18 +0200)
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>
drivers/gpu/drm/omapdrm/dss/dss.c

index 7a5f5f233ad0d6100cf8ee80a15adface623c3f2..14d2f024eb7098b29716fa29dc34cd7807a658c7 100644 (file)
@@ -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 = {