[PATCH v4 05/13] driver: add dev_get_priv() helper
Oleksij Rempel
o.rempel at pengutronix.de
Fri Apr 8 01:29:42 PDT 2022
Add dev_get_priv() to make driver porting easier. Needed for SJA11xx
switch driver.
Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
include/driver.h | 5 +++++
1 file changed, 5 insertions(+)
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 */
--
2.30.2
More information about the barebox
mailing list