put_bus() should not be globally visable as it is not used by anything
other than drivers/base/bus.c. This patch removes the visability of it,
and renames it to match all of the other *_put() functions in the
kernel.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
extern void bus_attach_device(struct device * dev);
extern void bus_remove_device(struct device * dev);
extern struct bus_type *get_bus(struct bus_type * bus);
extern void bus_attach_device(struct device * dev);
extern void bus_remove_device(struct device * dev);
extern struct bus_type *get_bus(struct bus_type * bus);
-extern void put_bus(struct bus_type * bus);
extern int bus_add_driver(struct device_driver *);
extern void bus_remove_driver(struct device_driver *);
extern int bus_add_driver(struct device_driver *);
extern void bus_remove_driver(struct device_driver *);
static int __must_check bus_rescan_devices_helper(struct device *dev,
void *data);
static int __must_check bus_rescan_devices_helper(struct device *dev,
void *data);
+static void bus_put(struct bus_type *bus)
+{
+ kset_put(&bus->subsys);
+}
+
static ssize_t
drv_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
{
static ssize_t
drv_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
{
int error;
if (get_bus(bus)) {
error = sysfs_create_file(&bus->subsys.kobj, &attr->attr);
int error;
if (get_bus(bus)) {
error = sysfs_create_file(&bus->subsys.kobj, &attr->attr);
} else
error = -EINVAL;
return error;
} else
error = -EINVAL;
return error;
{
if (get_bus(bus)) {
sysfs_remove_file(&bus->subsys.kobj, &attr->attr);
{
if (get_bus(bus)) {
sysfs_remove_file(&bus->subsys.kobj, &attr->attr);
err = count;
}
put_device(dev);
err = count;
}
put_device(dev);
return err;
}
static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
return err;
}
static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
err = -ENODEV;
}
put_device(dev);
err = -ENODEV;
}
put_device(dev);
return err;
}
static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
return err;
}
static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
out_id:
device_remove_attrs(bus, dev);
out_put:
out_id:
device_remove_attrs(bus, dev);
out_put:
}
pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
device_release_driver(dev);
}
pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
device_release_driver(dev);
out_unregister:
kobject_unregister(&drv->kobj);
out_put_bus:
out_unregister:
kobject_unregister(&drv->kobj);
out_put_bus:
driver_detach(drv);
module_remove_driver(drv);
kobject_unregister(&drv->kobj);
driver_detach(drv);
module_remove_driver(drv);
kobject_unregister(&drv->kobj);
struct bus_type, subsys) : NULL;
}
struct bus_type, subsys) : NULL;
}
-void put_bus(struct bus_type * bus)
-{
- kset_put(&bus->subsys);
-}
-
-
/**
* find_bus - locate bus by name.
* @name: name of bus.
/**
* find_bus - locate bus by name.
* @name: name of bus.
* @bus: bus.
*
* Unregister the child subsystems and the bus itself.
* @bus: bus.
*
* Unregister the child subsystems and the bus itself.
- * Finally, we call put_bus() to release the refcount
+ * Finally, we call bus_put() to release the refcount
*/
void bus_unregister(struct bus_type * bus)
{
*/
void bus_unregister(struct bus_type * bus)
{