[PATCH 2/7] include: driver: make dev_(get_priv|is_probed) argument const pointer

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jan 9 07:11:47 PST 2023


This enables us to use the helpers in functions that themselves take a
const pointer to document their usage.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 include/driver.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/driver.h b/include/driver.h
index 0ea5799d0dfb..7b04d61d168a 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -627,12 +627,12 @@ static inline struct device_node *dev_of_node(struct device *dev)
 	return IS_ENABLED(CONFIG_OFDEVICE) ? dev->of_node : NULL;
 }
 
-static inline void *dev_get_priv(struct device *dev)
+static inline void *dev_get_priv(const struct device *dev)
 {
 	return dev->priv;
 }
 
-static inline bool dev_is_probed(struct device *dev)
+static inline bool dev_is_probed(const struct device *dev)
 {
 	return dev->driver ? true : false;
 }
-- 
2.30.2




More information about the barebox mailing list