Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67943
b: refs/heads/master
c: fc1ede5
h: refs/heads/master
i:
  67941: efbe25d
  67939: b21eceb
  67935: 0823c4f
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 12, 2007
1 parent 886784e commit 8eb59ab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ef4cfac01fb5e98900f5bdb2a722aac1daff11b
refs/heads/master: fc1ede5888ab8a9b3e7f8567b945beed35222885
1 change: 0 additions & 1 deletion trunk/drivers/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern int bus_add_device(struct device * dev);
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 *);
Expand Down
29 changes: 14 additions & 15 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
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)
{
Expand Down Expand Up @@ -124,7 +129,7 @@ int bus_create_file(struct bus_type * bus, struct bus_attribute * attr)
int error;
if (get_bus(bus)) {
error = sysfs_create_file(&bus->subsys.kobj, &attr->attr);
put_bus(bus);
bus_put(bus);
} else
error = -EINVAL;
return error;
Expand All @@ -134,7 +139,7 @@ void bus_remove_file(struct bus_type * bus, struct bus_attribute * attr)
{
if (get_bus(bus)) {
sysfs_remove_file(&bus->subsys.kobj, &attr->attr);
put_bus(bus);
bus_put(bus);
}
}

Expand Down Expand Up @@ -186,7 +191,7 @@ static ssize_t driver_unbind(struct device_driver *drv,
err = count;
}
put_device(dev);
put_bus(bus);
bus_put(bus);
return err;
}
static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
Expand Down Expand Up @@ -219,7 +224,7 @@ static ssize_t driver_bind(struct device_driver *drv,
err = -ENODEV;
}
put_device(dev);
put_bus(bus);
bus_put(bus);
return err;
}
static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
Expand Down Expand Up @@ -459,7 +464,7 @@ int bus_add_device(struct device * dev)
out_id:
device_remove_attrs(bus, dev);
out_put:
put_bus(dev->bus);
bus_put(dev->bus);
return error;
}

Expand Down Expand Up @@ -509,7 +514,7 @@ void bus_remove_device(struct device * dev)
}
pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
device_release_driver(dev);
put_bus(dev->bus);
bus_put(dev->bus);
}
}

Expand Down Expand Up @@ -646,7 +651,7 @@ int bus_add_driver(struct device_driver *drv)
out_unregister:
kobject_unregister(&drv->kobj);
out_put_bus:
put_bus(bus);
bus_put(bus);
return error;
}

Expand All @@ -671,7 +676,7 @@ void bus_remove_driver(struct device_driver * drv)
driver_detach(drv);
module_remove_driver(drv);
kobject_unregister(&drv->kobj);
put_bus(drv->bus);
bus_put(drv->bus);
}


Expand Down Expand Up @@ -732,12 +737,6 @@ struct bus_type *get_bus(struct bus_type *bus)
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.
Expand Down Expand Up @@ -874,7 +873,7 @@ int bus_register(struct bus_type * bus)
* @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)
{
Expand Down

0 comments on commit 8eb59ab

Please sign in to comment.