summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-04-13 10:21:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-04-14 09:42:09 +0200
commite2c7f0f57829f4ab68077c77b5ac9e8fded56f6c (patch)
treefba2168d69f5bd0661e5fc9c918190918678c4cd /include
parentd64486483505cf01fb4b4d141b33fcb0b90ee1e9 (diff)
downloadbarebox-e2c7f0f57829f4ab68077c77b5ac9e8fded56f6c.tar.gz
barebox-e2c7f0f57829f4ab68077c77b5ac9e8fded56f6c.tar.xz
driver: add dev_get_priv() helper
Add dev_get_priv() to make driver porting easier. Needed for SJA11xx switch driver. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-6-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/driver.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 85cb30f8b0..b35b5f397e 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -603,4 +603,9 @@ static inline struct device_node *dev_of_node(struct device_d *dev)
return IS_ENABLED(CONFIG_OFDEVICE) ? dev->device_node : NULL;
}
+static inline void *dev_get_priv(struct device_d *dev)
+{
+ return dev->priv;
+}
+
#endif /* DRIVER_H */