lkml.org 
[lkml]   [2019]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 05/35] drm/exynos: mic: Stop using drm_bridge->driver_private
Date
Use a container_of wrapper instead. Note that no logic depends on
driver_private being NULL or not, so the cleanup in exynos_mic_bind is
safe to apply.

Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---

Reviewer note: the driver_private cleanup used to be part of the
relevant drm_bridge_init() patch.

drivers/gpu/drm/exynos/exynos_drm_mic.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index f41d75923557..2b5f10c3a285 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -106,6 +106,8 @@ struct exynos_mic {
bool enabled;
};

+#define bridge_to_exynos_mic(b) container_of((b), struct exynos_mic, bridge)
+
static void mic_set_path(struct exynos_mic *mic, bool enable)
{
int ret;
@@ -232,7 +234,7 @@ static void mic_disable(struct drm_bridge *bridge) { }

static void mic_post_disable(struct drm_bridge *bridge)
{
- struct exynos_mic *mic = bridge->driver_private;
+ struct exynos_mic *mic = bridge_to_exynos_mic(bridge);

mutex_lock(&mic_mutex);
if (!mic->enabled)
@@ -251,7 +253,7 @@ static void mic_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode)
{
- struct exynos_mic *mic = bridge->driver_private;
+ struct exynos_mic *mic = bridge_to_exynos_mic(bridge);

mutex_lock(&mic_mutex);
drm_display_mode_to_videomode(mode, &mic->vm);
@@ -261,7 +263,7 @@ static void mic_mode_set(struct drm_bridge *bridge,

static void mic_pre_enable(struct drm_bridge *bridge)
{
- struct exynos_mic *mic = bridge->driver_private;
+ struct exynos_mic *mic = bridge_to_exynos_mic(bridge);
int ret;

mutex_lock(&mic_mutex);
@@ -309,10 +311,6 @@ static const struct drm_bridge_funcs mic_bridge_funcs = {
static int exynos_mic_bind(struct device *dev, struct device *master,
void *data)
{
- struct exynos_mic *mic = dev_get_drvdata(dev);
-
- mic->bridge.driver_private = mic;
-
return 0;
}

--
2.24.0
\
 
 \ /
  Last update: 2019-12-24 18:35    [W:0.175 / U:6.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site