commit | 1b833924e5b3cea92306069a0f366529341dd260 | [log] [tgz] |
---|---|---|
author | Stephen Boyd <[email protected]> | Fri Apr 12 11:31:45 2019 -0700 |
committer | Stephen Boyd <[email protected]> | Fri Apr 19 14:24:32 2019 -0700 |
tree | 1be0f966cf28f5b0e05adc36d08ebfb38dc27b25 | |
parent | fceaa7d8004339820a0026d163b20becc796d1af [diff] [blame] |
driver core: Let dev_of_node() accept a NULL dev We'd like to chain this in places where the 'dev' argument might be NULL. Let this function take a NULL 'dev' so this can work. Cc: Miquel Raynal <[email protected]> Cc: Jerome Brunet <[email protected]> Cc: Russell King <[email protected]> Cc: Michael Turquette <[email protected]> Cc: Jeffrey Hugo <[email protected]> Cc: Chen-Yu Tsai <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Rob Herring <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Tested-by: Jeffrey Hugo <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
diff --git a/include/linux/device.h b/include/linux/device.h index b425a7e..0370dd0 100644 --- a/include/linux/device.h +++ b/include/linux/device.h
@@ -1231,7 +1231,7 @@ static inline void device_lock_assert(struct device *dev) static inline struct device_node *dev_of_node(struct device *dev) { - if (!IS_ENABLED(CONFIG_OF)) + if (!IS_ENABLED(CONFIG_OF) || !dev) return NULL; return dev->of_node; }