From 0b8c593910625ec39e6a01ea5aa17c2c64259c03 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Wed, 10 Jan 2018 17:23:41 +0100 Subject: BACKPORT: drm/bridge: analogix: Do not use device's drvdata The driver that instantiates the bridge should own the drvdata, as all driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also owned by its driver struct. Moreover, storing two different pointer types in driver data depending on driver initialization status is barely a good practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Change-Id: Ie06ce63a5daae532df69d2447b0673b91032d61c Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen Signed-off-by: Thierry Escande Reviewed-by: Andrzej Hajda Reviewed-by: Sean Paul Acked-by: Jingoo Han Acked-by: Archit Taneja Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20180110162348.22765-2-thierry.escande@collabora.com Signed-off-by: Wyon Bi (cherry-picked from 6b2d8fd98d051f8697c45f96249dca73842a2362) --- include/drm/bridge/analogix_dp.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index d51a694eb9ee..05c73743c6da 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -13,6 +13,8 @@ #include +struct analogix_dp_device; + enum analogix_dp_devtype { EXYNOS_DP, ROCKCHIP_DP, @@ -39,11 +41,12 @@ struct analogix_dp_plat_data { struct drm_connector *); }; -int analogix_dp_resume(struct device *dev); -int analogix_dp_suspend(struct device *dev); +int analogix_dp_resume(struct analogix_dp_device *dp); +int analogix_dp_suspend(struct analogix_dp_device *dp); -int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, - struct analogix_dp_plat_data *plat_data); -void analogix_dp_unbind(struct device *dev, struct device *master, void *data); +struct analogix_dp_device * +analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, + struct analogix_dp_plat_data *plat_data); +void analogix_dp_unbind(struct analogix_dp_device *dp); #endif /* _ANALOGIX_DP_H_ */ -- cgit v1.2.3