[PATCH] fixup! clk: stm32mp1: sync with Linux v5.17-rc1

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Feb 21 02:35:53 PST 2022


This allows discarding code at compile-time for drivers that can be
compiled without DT support.

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

diff --git a/include/driver.h b/include/driver.h
index 1ee255c9ad0c..85cb30f8b0b1 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -600,7 +600,7 @@ struct device_d *device_find_child(struct device_d *parent, void *data,
 
 static inline struct device_node *dev_of_node(struct device_d *dev)
 {
-	return dev->device_node;
+	return IS_ENABLED(CONFIG_OFDEVICE) ? dev->device_node : NULL;
 }
 
 #endif /* DRIVER_H */
-- 
2.30.2




More information about the barebox mailing list