From 4f83479891430556dbe287d465ea611f2f49e82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sun, 10 Feb 2019 14:10:34 +0100 Subject: drm/tinydrm/mipi-dbi: Add drm_to_mipi_dbi() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a function to derive mipi_dbi from drm_device now that tinydrm_device is going away. Signed-off-by: Noralf Trønnes Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20190210131039.52664-8-noralf@tronnes.org --- include/drm/tinydrm/mipi-dbi.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/drm/tinydrm') diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h index f4ec2834bc22..ad7e6bedab5f 100644 --- a/include/drm/tinydrm/mipi-dbi.h +++ b/include/drm/tinydrm/mipi-dbi.h @@ -56,9 +56,10 @@ struct mipi_dbi { struct regulator *regulator; }; -static inline struct mipi_dbi * -mipi_dbi_from_tinydrm(struct tinydrm_device *tdev) +static inline struct mipi_dbi *drm_to_mipi_dbi(struct drm_device *drm) { + struct tinydrm_device *tdev = drm->dev_private; + return container_of(tdev, struct mipi_dbi, tinydrm); } -- cgit v1.2.3