[v3,03/35] drm/bridge/synopsys: Stop using drm_bridge->driver_private
diff mbox series

Message ID 20191224173408.25624-4-mihail.atanassov@arm.com
State New
Headers show
Series
  • drm/bridge: Consolidate initialization
Related show

Commit Message

Mihail Atanassov Dec. 24, 2019, 5:34 p.m. UTC
dw_hdmi: The drm_bridge struct is already embedded, so use
a container_of wrapper to access it.

dw-mipi-dsi: The field is unused, remove it.

Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     | 15 ++++++++-------
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  1 -
 2 files changed, 8 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 99274ca0fdf6..946aa1af8841 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -196,6 +196,8 @@  struct dw_hdmi {
 	struct cec_notifier *cec_notifier;
 };
 
+#define bridge_to_dw_hdmi(b) container_of((b), struct dw_hdmi, bridge)
+
 #define HDMI_IH_PHY_STAT0_RX_SENSE \
 	(HDMI_IH_PHY_STAT0_RX_SENSE0 | HDMI_IH_PHY_STAT0_RX_SENSE1 | \
 	 HDMI_IH_PHY_STAT0_RX_SENSE2 | HDMI_IH_PHY_STAT0_RX_SENSE3)
@@ -2335,7 +2337,7 @@  static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs =
 
 static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 	struct drm_encoder *encoder = bridge->encoder;
 	struct drm_connector *connector = &hdmi->connector;
 	struct cec_connector_info conn_info;
@@ -2372,7 +2374,7 @@  static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
 
 static void dw_hdmi_bridge_detach(struct drm_bridge *bridge)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 
 	mutex_lock(&hdmi->cec_notifier_mutex);
 	cec_notifier_conn_unregister(hdmi->cec_notifier);
@@ -2384,7 +2386,7 @@  static enum drm_mode_status
 dw_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
 			  const struct drm_display_mode *mode)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 	struct drm_connector *connector = &hdmi->connector;
 	enum drm_mode_status mode_status = MODE_OK;
 
@@ -2402,7 +2404,7 @@  static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
 				    const struct drm_display_mode *orig_mode,
 				    const struct drm_display_mode *mode)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 
 	mutex_lock(&hdmi->mutex);
 
@@ -2414,7 +2416,7 @@  static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
 
 static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 
 	mutex_lock(&hdmi->mutex);
 	hdmi->disabled = true;
@@ -2425,7 +2427,7 @@  static void dw_hdmi_bridge_disable(struct drm_bridge *bridge)
 
 static void dw_hdmi_bridge_enable(struct drm_bridge *bridge)
 {
-	struct dw_hdmi *hdmi = bridge->driver_private;
+	struct dw_hdmi *hdmi = bridge_to_dw_hdmi(bridge);
 
 	mutex_lock(&hdmi->mutex);
 	hdmi->disabled = false;
@@ -2898,7 +2900,6 @@  __dw_hdmi_probe(struct platform_device *pdev,
 			hdmi->ddc = NULL;
 	}
 
-	hdmi->bridge.driver_private = hdmi;
 	hdmi->bridge.funcs = &dw_hdmi_bridge_funcs;
 #ifdef CONFIG_OF
 	hdmi->bridge.of_node = pdev->dev.of_node;
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index b18351b6760a..3aa4f9289416 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -1064,7 +1064,6 @@  __dw_mipi_dsi_probe(struct platform_device *pdev,
 		return ERR_PTR(ret);
 	}
 
-	dsi->bridge.driver_private = dsi;
 	dsi->bridge.funcs = &dw_mipi_dsi_bridge_funcs;
 #ifdef CONFIG_OF
 	dsi->bridge.of_node = pdev->dev.of_node;