drm/sun4i: Store TCON's device structure pointer
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 19 Jul 2016 13:17:27 +0000 (15:17 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 22 Aug 2016 13:34:12 +0000 (15:34 +0200)
We will need to access TCON's struct device from outside of TCON's driver
bind function. Store it in our private structure.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_tcon.c
drivers/gpu/drm/sun4i/sun4i_tcon.h

index 652385f09735c3f4bb11b713809cc6b67034d459..af136dfc206ed4b3f85d076d145ec98709cef54b 100644 (file)
@@ -446,6 +446,7 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
        dev_set_drvdata(dev, tcon);
        drv->tcon = tcon;
        tcon->drm = drm;
+       tcon->dev = dev;
 
        if (of_device_is_compatible(dev->of_node, "allwinner,sun5i-a13-tcon"))
                tcon->has_mux = true;
index 0e0b11db401bda735a482a240971855f25fa0cac..230550b720f187b6e156b60ac3b74be2b6129392 100644 (file)
 #define SUN4I_TCON_MAX_CHANNELS                2
 
 struct sun4i_tcon {
+       struct device                   *dev;
        struct drm_device               *drm;
        struct regmap                   *regs;