Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: device.h: Group of_node handling declarations and definitions

There are a few of_node related APIs defined in the driver core.
Group the respective declarations and definitions in the header.
There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240531145129.1506733-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
1968845d 161364bd

+9 -8
+9 -8
include/linux/device.h
··· 1031 1031 lockdep_assert_held(&dev->mutex); 1032 1032 } 1033 1033 1034 - static inline struct device_node *dev_of_node(struct device *dev) 1035 - { 1036 - if (!IS_ENABLED(CONFIG_OF) || !dev) 1037 - return NULL; 1038 - return dev->of_node; 1039 - } 1040 - 1041 1034 static inline bool dev_has_sync_state(struct device *dev) 1042 1035 { 1043 1036 if (!dev) ··· 1137 1144 int lock_device_hotplug_sysfs(void); 1138 1145 int device_offline(struct device *dev); 1139 1146 int device_online(struct device *dev); 1147 + 1140 1148 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode); 1141 1149 void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode); 1142 - void device_set_of_node_from_dev(struct device *dev, const struct device *dev2); 1143 1150 void device_set_node(struct device *dev, struct fwnode_handle *fwnode); 1151 + void device_set_of_node_from_dev(struct device *dev, const struct device *dev2); 1152 + 1153 + static inline struct device_node *dev_of_node(struct device *dev) 1154 + { 1155 + if (!IS_ENABLED(CONFIG_OF) || !dev) 1156 + return NULL; 1157 + return dev->of_node; 1158 + } 1144 1159 1145 1160 static inline int dev_num_vf(struct device *dev) 1146 1161 {