@@ -110,7 +110,6 @@ extern void container_dev_init(void);
struct kobject *virtual_device_parent(struct device *dev);
-extern int bus_add_device(struct device *dev);
extern void bus_probe_device(struct device *dev);
extern void bus_remove_device(struct device *dev);
@@ -471,6 +471,7 @@ int bus_add_device(struct device *dev)
bus_put(dev->bus);
return error;
}
+EXPORT_SYMBOL_GPL(bus_add_device);
/**
* bus_probe_device - probe drivers for a new device
@@ -267,6 +267,8 @@ int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
void bus_sort_breadthfirst(struct bus_type *bus,
int (*compare)(const struct device *a,
const struct device *b));
+extern int bus_add_device(struct device *dev);
+
/*
* Bus notifiers: Get notified of addition/removal of devices
* and binding/unbinding of drivers to devices.
Move the bus_add_device() to a public API, so it can be applied to devices which are temporarily detached from their buses without being destroyed. This will be used after changes in PCI topology after hotplugging a bridge: buses may get their numbers changed, so their child devices must be reattached and their sysfs and proc files recreated. Signed-off-by: Sergey Miroshnichenko <s.miroshnichenko@yadro.com> --- drivers/base/base.h | 1 - drivers/base/bus.c | 1 + include/linux/device.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-)