drm/sun4i: backend: Save pointer to device tree node
authorChen-Yu Tsai <wens@csie.org>
Fri, 21 Apr 2017 08:38:53 +0000 (16:38 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Sun, 14 May 2017 06:27:41 +0000 (08:27 +0200)
Save a pointer to the backend's underlying device tree node in its
data structure. This will be used later for downstream tcons to find
and match their respective upstream backends.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_backend.h

index 0b4222312e492d29c7c9696df4742208707b1e24..e9eca057ff353fecb5ae932e3d58f11d833b194c 100644 (file)
@@ -352,6 +352,7 @@ static int sun4i_backend_bind(struct device *dev, struct device *master,
                return -ENOMEM;
        dev_set_drvdata(dev, backend);
 
+       backend->node = dev->of_node;
        backend->id = sun4i_backend_of_get_id(dev->of_node);
        if (backend->id < 0)
                return backend->id;
index 45b7fc110590994130f810c44b41c459e0ab9ec5..6327a2985fe6c82f679cb1d7ed8ebb4bbe484b22 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <linux/clk.h>
 #include <linux/list.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
 #define SUN4I_BACKEND_PIPE_OFF(p)              (0x5000 + (0x400 * (p)))
 
 struct sun4i_backend {
+       struct device_node      *node;
        struct regmap           *regs;
 
        struct reset_control    *reset;