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

device.h: move 'struct bus' stuff out to device/bus.h

device.h has everything and the kitchen sink when it comes to struct
device things, so split out the struct bus things things to a separate
.h file to make things easier to maintain and manage over time.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20191209193303.1694546-5-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+290 -264
+1
drivers/base/bus.c
··· 9 9 */ 10 10 11 11 #include <linux/async.h> 12 + #include <linux/device/bus.h> 12 13 #include <linux/device.h> 13 14 #include <linux/module.h> 14 15 #include <linux/errno.h>
+1 -264
include/linux/device.h
··· 26 26 #include <linux/uidgid.h> 27 27 #include <linux/gfp.h> 28 28 #include <linux/overflow.h> 29 + #include <linux/device/bus.h> 29 30 #include <asm/device.h> 30 31 31 32 struct device; ··· 36 35 struct module; 37 36 struct class; 38 37 struct subsys_private; 39 - struct bus_type; 40 38 struct device_node; 41 39 struct fwnode_handle; 42 40 struct iommu_ops; ··· 43 43 struct iommu_fwspec; 44 44 struct dev_pin_info; 45 45 struct iommu_param; 46 - 47 - struct bus_attribute { 48 - struct attribute attr; 49 - ssize_t (*show)(struct bus_type *bus, char *buf); 50 - ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); 51 - }; 52 - 53 - #define BUS_ATTR_RW(_name) \ 54 - struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) 55 - #define BUS_ATTR_RO(_name) \ 56 - struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) 57 - #define BUS_ATTR_WO(_name) \ 58 - struct bus_attribute bus_attr_##_name = __ATTR_WO(_name) 59 - 60 - extern int __must_check bus_create_file(struct bus_type *, 61 - struct bus_attribute *); 62 - extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 63 - 64 - /** 65 - * struct bus_type - The bus type of the device 66 - * 67 - * @name: The name of the bus. 68 - * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). 69 - * @dev_root: Default device to use as the parent. 70 - * @bus_groups: Default attributes of the bus. 71 - * @dev_groups: Default attributes of the devices on the bus. 72 - * @drv_groups: Default attributes of the device drivers on the bus. 73 - * @match: Called, perhaps multiple times, whenever a new device or driver 74 - * is added for this bus. It should return a positive value if the 75 - * given device can be handled by the given driver and zero 76 - * otherwise. It may also return error code if determining that 77 - * the driver supports the device is not possible. In case of 78 - * -EPROBE_DEFER it will queue the device for deferred probing. 79 - * @uevent: Called when a device is added, removed, or a few other things 80 - * that generate uevents to add the environment variables. 81 - * @probe: Called when a new device or driver add to this bus, and callback 82 - * the specific driver's probe to initial the matched device. 83 - * @sync_state: Called to sync device state to software state after all the 84 - * state tracking consumers linked to this device (present at 85 - * the time of late_initcall) have successfully bound to a 86 - * driver. If the device has no consumers, this function will 87 - * be called at late_initcall_sync level. If the device has 88 - * consumers that are never bound to a driver, this function 89 - * will never get called until they do. 90 - * @remove: Called when a device removed from this bus. 91 - * @shutdown: Called at shut-down time to quiesce the device. 92 - * 93 - * @online: Called to put the device back online (after offlining it). 94 - * @offline: Called to put the device offline for hot-removal. May fail. 95 - * 96 - * @suspend: Called when a device on this bus wants to go to sleep mode. 97 - * @resume: Called to bring a device on this bus out of sleep mode. 98 - * @num_vf: Called to find out how many virtual functions a device on this 99 - * bus supports. 100 - * @dma_configure: Called to setup DMA configuration on a device on 101 - * this bus. 102 - * @pm: Power management operations of this bus, callback the specific 103 - * device driver's pm-ops. 104 - * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU 105 - * driver implementations to a bus and allow the driver to do 106 - * bus-specific setup 107 - * @p: The private data of the driver core, only the driver core can 108 - * touch this. 109 - * @lock_key: Lock class key for use by the lock validator 110 - * @need_parent_lock: When probing or removing a device on this bus, the 111 - * device core should lock the device's parent. 112 - * 113 - * A bus is a channel between the processor and one or more devices. For the 114 - * purposes of the device model, all devices are connected via a bus, even if 115 - * it is an internal, virtual, "platform" bus. Buses can plug into each other. 116 - * A USB controller is usually a PCI device, for example. The device model 117 - * represents the actual connections between buses and the devices they control. 118 - * A bus is represented by the bus_type structure. It contains the name, the 119 - * default attributes, the bus' methods, PM operations, and the driver core's 120 - * private data. 121 - */ 122 - struct bus_type { 123 - const char *name; 124 - const char *dev_name; 125 - struct device *dev_root; 126 - const struct attribute_group **bus_groups; 127 - const struct attribute_group **dev_groups; 128 - const struct attribute_group **drv_groups; 129 - 130 - int (*match)(struct device *dev, struct device_driver *drv); 131 - int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 132 - int (*probe)(struct device *dev); 133 - void (*sync_state)(struct device *dev); 134 - int (*remove)(struct device *dev); 135 - void (*shutdown)(struct device *dev); 136 - 137 - int (*online)(struct device *dev); 138 - int (*offline)(struct device *dev); 139 - 140 - int (*suspend)(struct device *dev, pm_message_t state); 141 - int (*resume)(struct device *dev); 142 - 143 - int (*num_vf)(struct device *dev); 144 - 145 - int (*dma_configure)(struct device *dev); 146 - 147 - const struct dev_pm_ops *pm; 148 - 149 - const struct iommu_ops *iommu_ops; 150 - 151 - struct subsys_private *p; 152 - struct lock_class_key lock_key; 153 - 154 - bool need_parent_lock; 155 - }; 156 - 157 - extern int __must_check bus_register(struct bus_type *bus); 158 - 159 - extern void bus_unregister(struct bus_type *bus); 160 - 161 - extern int __must_check bus_rescan_devices(struct bus_type *bus); 162 - 163 - /* iterator helpers for buses */ 164 - struct subsys_dev_iter { 165 - struct klist_iter ki; 166 - const struct device_type *type; 167 - }; 168 - void subsys_dev_iter_init(struct subsys_dev_iter *iter, 169 - struct bus_type *subsys, 170 - struct device *start, 171 - const struct device_type *type); 172 - struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter); 173 - void subsys_dev_iter_exit(struct subsys_dev_iter *iter); 174 - 175 - int device_match_name(struct device *dev, const void *name); 176 - int device_match_of_node(struct device *dev, const void *np); 177 - int device_match_fwnode(struct device *dev, const void *fwnode); 178 - int device_match_devt(struct device *dev, const void *pdevt); 179 - int device_match_acpi_dev(struct device *dev, const void *adev); 180 - int device_match_any(struct device *dev, const void *unused); 181 - 182 - int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, 183 - int (*fn)(struct device *dev, void *data)); 184 - struct device *bus_find_device(struct bus_type *bus, struct device *start, 185 - const void *data, 186 - int (*match)(struct device *dev, const void *data)); 187 - /** 188 - * bus_find_device_by_name - device iterator for locating a particular device 189 - * of a specific name. 190 - * @bus: bus type 191 - * @start: Device to begin with 192 - * @name: name of the device to match 193 - */ 194 - static inline struct device *bus_find_device_by_name(struct bus_type *bus, 195 - struct device *start, 196 - const char *name) 197 - { 198 - return bus_find_device(bus, start, name, device_match_name); 199 - } 200 - 201 - /** 202 - * bus_find_device_by_of_node : device iterator for locating a particular device 203 - * matching the of_node. 204 - * @bus: bus type 205 - * @np: of_node of the device to match. 206 - */ 207 - static inline struct device * 208 - bus_find_device_by_of_node(struct bus_type *bus, const struct device_node *np) 209 - { 210 - return bus_find_device(bus, NULL, np, device_match_of_node); 211 - } 212 - 213 - /** 214 - * bus_find_device_by_fwnode : device iterator for locating a particular device 215 - * matching the fwnode. 216 - * @bus: bus type 217 - * @fwnode: fwnode of the device to match. 218 - */ 219 - static inline struct device * 220 - bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode) 221 - { 222 - return bus_find_device(bus, NULL, fwnode, device_match_fwnode); 223 - } 224 - 225 - /** 226 - * bus_find_device_by_devt : device iterator for locating a particular device 227 - * matching the device type. 228 - * @bus: bus type 229 - * @devt: device type of the device to match. 230 - */ 231 - static inline struct device *bus_find_device_by_devt(struct bus_type *bus, 232 - dev_t devt) 233 - { 234 - return bus_find_device(bus, NULL, &devt, device_match_devt); 235 - } 236 - 237 - /** 238 - * bus_find_next_device - Find the next device after a given device in a 239 - * given bus. 240 - * @bus: bus type 241 - * @cur: device to begin the search with. 242 - */ 243 - static inline struct device * 244 - bus_find_next_device(struct bus_type *bus,struct device *cur) 245 - { 246 - return bus_find_device(bus, cur, NULL, device_match_any); 247 - } 248 - 249 - #ifdef CONFIG_ACPI 250 - struct acpi_device; 251 - 252 - /** 253 - * bus_find_device_by_acpi_dev : device iterator for locating a particular device 254 - * matching the ACPI COMPANION device. 255 - * @bus: bus type 256 - * @adev: ACPI COMPANION device to match. 257 - */ 258 - static inline struct device * 259 - bus_find_device_by_acpi_dev(struct bus_type *bus, const struct acpi_device *adev) 260 - { 261 - return bus_find_device(bus, NULL, adev, device_match_acpi_dev); 262 - } 263 - #else 264 - static inline struct device * 265 - bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev) 266 - { 267 - return NULL; 268 - } 269 - #endif 270 - 271 - struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id, 272 - struct device *hint); 273 - int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 274 - void *data, int (*fn)(struct device_driver *, void *)); 275 - void bus_sort_breadthfirst(struct bus_type *bus, 276 - int (*compare)(const struct device *a, 277 - const struct device *b)); 278 - /* 279 - * Bus notifiers: Get notified of addition/removal of devices 280 - * and binding/unbinding of drivers to devices. 281 - * In the long run, it should be a replacement for the platform 282 - * notify hooks. 283 - */ 284 - struct notifier_block; 285 - 286 - extern int bus_register_notifier(struct bus_type *bus, 287 - struct notifier_block *nb); 288 - extern int bus_unregister_notifier(struct bus_type *bus, 289 - struct notifier_block *nb); 290 - 291 - /* All 4 notifers below get called with the target struct device * 292 - * as an argument. Note that those functions are likely to be called 293 - * with the device lock held in the core, so be careful. 294 - */ 295 - #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ 296 - #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device to be removed */ 297 - #define BUS_NOTIFY_REMOVED_DEVICE 0x00000003 /* device removed */ 298 - #define BUS_NOTIFY_BIND_DRIVER 0x00000004 /* driver about to be 299 - bound */ 300 - #define BUS_NOTIFY_BOUND_DRIVER 0x00000005 /* driver bound to device */ 301 - #define BUS_NOTIFY_UNBIND_DRIVER 0x00000006 /* driver about to be 302 - unbound */ 303 - #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000007 /* driver is unbound 304 - from the device */ 305 - #define BUS_NOTIFY_DRIVER_NOT_BOUND 0x00000008 /* driver fails to be bound */ 306 - 307 - extern struct kset *bus_get_kset(struct bus_type *bus); 308 - extern struct klist *bus_get_device_klist(struct bus_type *bus); 309 46 310 47 /** 311 48 * enum probe_type - device driver probe type to try
+288
include/linux/device/bus.h
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * bus.h - the bus-specific portions of the driver model 4 + * 5 + * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> 6 + * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de> 7 + * Copyright (c) 2008-2009 Novell Inc. 8 + * Copyright (c) 2012-2019 Greg Kroah-Hartman <gregkh@linuxfoundation.org> 9 + * Copyright (c) 2012-2019 Linux Foundation 10 + * 11 + * See Documentation/driver-api/driver-model/ for more information. 12 + */ 13 + 14 + #ifndef _DEVICE_BUS_H_ 15 + #define _DEVICE_BUS_H_ 16 + 17 + #include <linux/kobject.h> 18 + #include <linux/klist.h> 19 + #include <linux/pm.h> 20 + 21 + struct device_driver; 22 + struct fwnode_handle; 23 + 24 + /** 25 + * struct bus_type - The bus type of the device 26 + * 27 + * @name: The name of the bus. 28 + * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). 29 + * @dev_root: Default device to use as the parent. 30 + * @bus_groups: Default attributes of the bus. 31 + * @dev_groups: Default attributes of the devices on the bus. 32 + * @drv_groups: Default attributes of the device drivers on the bus. 33 + * @match: Called, perhaps multiple times, whenever a new device or driver 34 + * is added for this bus. It should return a positive value if the 35 + * given device can be handled by the given driver and zero 36 + * otherwise. It may also return error code if determining that 37 + * the driver supports the device is not possible. In case of 38 + * -EPROBE_DEFER it will queue the device for deferred probing. 39 + * @uevent: Called when a device is added, removed, or a few other things 40 + * that generate uevents to add the environment variables. 41 + * @probe: Called when a new device or driver add to this bus, and callback 42 + * the specific driver's probe to initial the matched device. 43 + * @sync_state: Called to sync device state to software state after all the 44 + * state tracking consumers linked to this device (present at 45 + * the time of late_initcall) have successfully bound to a 46 + * driver. If the device has no consumers, this function will 47 + * be called at late_initcall_sync level. If the device has 48 + * consumers that are never bound to a driver, this function 49 + * will never get called until they do. 50 + * @remove: Called when a device removed from this bus. 51 + * @shutdown: Called at shut-down time to quiesce the device. 52 + * 53 + * @online: Called to put the device back online (after offlining it). 54 + * @offline: Called to put the device offline for hot-removal. May fail. 55 + * 56 + * @suspend: Called when a device on this bus wants to go to sleep mode. 57 + * @resume: Called to bring a device on this bus out of sleep mode. 58 + * @num_vf: Called to find out how many virtual functions a device on this 59 + * bus supports. 60 + * @dma_configure: Called to setup DMA configuration on a device on 61 + * this bus. 62 + * @pm: Power management operations of this bus, callback the specific 63 + * device driver's pm-ops. 64 + * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU 65 + * driver implementations to a bus and allow the driver to do 66 + * bus-specific setup 67 + * @p: The private data of the driver core, only the driver core can 68 + * touch this. 69 + * @lock_key: Lock class key for use by the lock validator 70 + * @need_parent_lock: When probing or removing a device on this bus, the 71 + * device core should lock the device's parent. 72 + * 73 + * A bus is a channel between the processor and one or more devices. For the 74 + * purposes of the device model, all devices are connected via a bus, even if 75 + * it is an internal, virtual, "platform" bus. Buses can plug into each other. 76 + * A USB controller is usually a PCI device, for example. The device model 77 + * represents the actual connections between buses and the devices they control. 78 + * A bus is represented by the bus_type structure. It contains the name, the 79 + * default attributes, the bus' methods, PM operations, and the driver core's 80 + * private data. 81 + */ 82 + struct bus_type { 83 + const char *name; 84 + const char *dev_name; 85 + struct device *dev_root; 86 + const struct attribute_group **bus_groups; 87 + const struct attribute_group **dev_groups; 88 + const struct attribute_group **drv_groups; 89 + 90 + int (*match)(struct device *dev, struct device_driver *drv); 91 + int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 92 + int (*probe)(struct device *dev); 93 + void (*sync_state)(struct device *dev); 94 + int (*remove)(struct device *dev); 95 + void (*shutdown)(struct device *dev); 96 + 97 + int (*online)(struct device *dev); 98 + int (*offline)(struct device *dev); 99 + 100 + int (*suspend)(struct device *dev, pm_message_t state); 101 + int (*resume)(struct device *dev); 102 + 103 + int (*num_vf)(struct device *dev); 104 + 105 + int (*dma_configure)(struct device *dev); 106 + 107 + const struct dev_pm_ops *pm; 108 + 109 + const struct iommu_ops *iommu_ops; 110 + 111 + struct subsys_private *p; 112 + struct lock_class_key lock_key; 113 + 114 + bool need_parent_lock; 115 + }; 116 + 117 + extern int __must_check bus_register(struct bus_type *bus); 118 + 119 + extern void bus_unregister(struct bus_type *bus); 120 + 121 + extern int __must_check bus_rescan_devices(struct bus_type *bus); 122 + 123 + struct bus_attribute { 124 + struct attribute attr; 125 + ssize_t (*show)(struct bus_type *bus, char *buf); 126 + ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); 127 + }; 128 + 129 + #define BUS_ATTR_RW(_name) \ 130 + struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) 131 + #define BUS_ATTR_RO(_name) \ 132 + struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) 133 + #define BUS_ATTR_WO(_name) \ 134 + struct bus_attribute bus_attr_##_name = __ATTR_WO(_name) 135 + 136 + extern int __must_check bus_create_file(struct bus_type *, 137 + struct bus_attribute *); 138 + extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 139 + 140 + /* Generic device matching functions that all busses can use to match with */ 141 + int device_match_name(struct device *dev, const void *name); 142 + int device_match_of_node(struct device *dev, const void *np); 143 + int device_match_fwnode(struct device *dev, const void *fwnode); 144 + int device_match_devt(struct device *dev, const void *pdevt); 145 + int device_match_acpi_dev(struct device *dev, const void *adev); 146 + int device_match_any(struct device *dev, const void *unused); 147 + 148 + /* iterator helpers for buses */ 149 + struct subsys_dev_iter { 150 + struct klist_iter ki; 151 + const struct device_type *type; 152 + }; 153 + void subsys_dev_iter_init(struct subsys_dev_iter *iter, 154 + struct bus_type *subsys, 155 + struct device *start, 156 + const struct device_type *type); 157 + struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter); 158 + void subsys_dev_iter_exit(struct subsys_dev_iter *iter); 159 + 160 + int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, 161 + int (*fn)(struct device *dev, void *data)); 162 + struct device *bus_find_device(struct bus_type *bus, struct device *start, 163 + const void *data, 164 + int (*match)(struct device *dev, const void *data)); 165 + /** 166 + * bus_find_device_by_name - device iterator for locating a particular device 167 + * of a specific name. 168 + * @bus: bus type 169 + * @start: Device to begin with 170 + * @name: name of the device to match 171 + */ 172 + static inline struct device *bus_find_device_by_name(struct bus_type *bus, 173 + struct device *start, 174 + const char *name) 175 + { 176 + return bus_find_device(bus, start, name, device_match_name); 177 + } 178 + 179 + /** 180 + * bus_find_device_by_of_node : device iterator for locating a particular device 181 + * matching the of_node. 182 + * @bus: bus type 183 + * @np: of_node of the device to match. 184 + */ 185 + static inline struct device * 186 + bus_find_device_by_of_node(struct bus_type *bus, const struct device_node *np) 187 + { 188 + return bus_find_device(bus, NULL, np, device_match_of_node); 189 + } 190 + 191 + /** 192 + * bus_find_device_by_fwnode : device iterator for locating a particular device 193 + * matching the fwnode. 194 + * @bus: bus type 195 + * @fwnode: fwnode of the device to match. 196 + */ 197 + static inline struct device * 198 + bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode) 199 + { 200 + return bus_find_device(bus, NULL, fwnode, device_match_fwnode); 201 + } 202 + 203 + /** 204 + * bus_find_device_by_devt : device iterator for locating a particular device 205 + * matching the device type. 206 + * @bus: bus type 207 + * @devt: device type of the device to match. 208 + */ 209 + static inline struct device *bus_find_device_by_devt(struct bus_type *bus, 210 + dev_t devt) 211 + { 212 + return bus_find_device(bus, NULL, &devt, device_match_devt); 213 + } 214 + 215 + /** 216 + * bus_find_next_device - Find the next device after a given device in a 217 + * given bus. 218 + * @bus: bus type 219 + * @cur: device to begin the search with. 220 + */ 221 + static inline struct device * 222 + bus_find_next_device(struct bus_type *bus,struct device *cur) 223 + { 224 + return bus_find_device(bus, cur, NULL, device_match_any); 225 + } 226 + 227 + #ifdef CONFIG_ACPI 228 + struct acpi_device; 229 + 230 + /** 231 + * bus_find_device_by_acpi_dev : device iterator for locating a particular device 232 + * matching the ACPI COMPANION device. 233 + * @bus: bus type 234 + * @adev: ACPI COMPANION device to match. 235 + */ 236 + static inline struct device * 237 + bus_find_device_by_acpi_dev(struct bus_type *bus, const struct acpi_device *adev) 238 + { 239 + return bus_find_device(bus, NULL, adev, device_match_acpi_dev); 240 + } 241 + #else 242 + static inline struct device * 243 + bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev) 244 + { 245 + return NULL; 246 + } 247 + #endif 248 + 249 + struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id, 250 + struct device *hint); 251 + int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 252 + void *data, int (*fn)(struct device_driver *, void *)); 253 + void bus_sort_breadthfirst(struct bus_type *bus, 254 + int (*compare)(const struct device *a, 255 + const struct device *b)); 256 + /* 257 + * Bus notifiers: Get notified of addition/removal of devices 258 + * and binding/unbinding of drivers to devices. 259 + * In the long run, it should be a replacement for the platform 260 + * notify hooks. 261 + */ 262 + struct notifier_block; 263 + 264 + extern int bus_register_notifier(struct bus_type *bus, 265 + struct notifier_block *nb); 266 + extern int bus_unregister_notifier(struct bus_type *bus, 267 + struct notifier_block *nb); 268 + 269 + /* All 4 notifers below get called with the target struct device * 270 + * as an argument. Note that those functions are likely to be called 271 + * with the device lock held in the core, so be careful. 272 + */ 273 + #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ 274 + #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device to be removed */ 275 + #define BUS_NOTIFY_REMOVED_DEVICE 0x00000003 /* device removed */ 276 + #define BUS_NOTIFY_BIND_DRIVER 0x00000004 /* driver about to be 277 + bound */ 278 + #define BUS_NOTIFY_BOUND_DRIVER 0x00000005 /* driver bound to device */ 279 + #define BUS_NOTIFY_UNBIND_DRIVER 0x00000006 /* driver about to be 280 + unbound */ 281 + #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000007 /* driver is unbound 282 + from the device */ 283 + #define BUS_NOTIFY_DRIVER_NOT_BOUND 0x00000008 /* driver fails to be bound */ 284 + 285 + extern struct kset *bus_get_kset(struct bus_type *bus); 286 + extern struct klist *bus_get_device_klist(struct bus_type *bus); 287 + 288 + #endif