diff mbox series

[RFC,12/15] drm: rcar-du: dsi: Turn container_of() wrappers to inline functions

Message ID 20210623034656.10316-13-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series R-Car V3U: DSI encoder driver | expand

Commit Message

Laurent Pinchart June 23, 2021, 3:46 a.m. UTC
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
index e8db56cc98f4..db31baecde7d 100644
--- a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
@@ -49,14 +49,17 @@  struct rcar_mipi_dsi {
 	unsigned int lanes;
 };
 
-#define bridge_to_rcar_mipi_dsi(b) \
-	container_of(b, struct rcar_mipi_dsi, bridge)
+static inline struct rcar_mipi_dsi *
+bridge_to_rcar_mipi_dsi(struct drm_bridge *bridge)
+{
+	return container_of(bridge, struct rcar_mipi_dsi, bridge);
+}
 
-#define connector_to_rcar_mipi_dsi(c) \
-	container_of(c, struct rcar_mipi_dsi, connector)
-
-#define host_to_rcar_mipi_dsi(c) \
-	container_of(c, struct rcar_mipi_dsi, host)
+static inline struct rcar_mipi_dsi *
+host_to_rcar_mipi_dsi(struct mipi_dsi_host *host)
+{
+	return container_of(host, struct rcar_mipi_dsi, host);
+}
 
 static const u32 phtw[] = {
 	0x01020114, 0x01600115, /* General testing */