Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67936
b: refs/heads/master
c: 8380770
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 0823c4f commit 211ed4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 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: 3b6662f192fc521b9657f63e68d20ec99979dae6
refs/heads/master: 8380770c842faef3001e44662953d64ad9a93663
21 changes: 9 additions & 12 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,32 +568,29 @@ static void remove_bind_files(struct device_driver *drv)
driver_remove_file(drv, &driver_attr_unbind);
}

static BUS_ATTR(drivers_probe, S_IWUSR, NULL, store_drivers_probe);
static BUS_ATTR(drivers_autoprobe, S_IWUSR | S_IRUGO,
show_drivers_autoprobe, store_drivers_autoprobe);

static int add_probe_files(struct bus_type *bus)
{
int retval;

bus->drivers_probe_attr.attr.name = "drivers_probe";
bus->drivers_probe_attr.attr.mode = S_IWUSR;
bus->drivers_probe_attr.store = store_drivers_probe;
retval = bus_create_file(bus, &bus->drivers_probe_attr);
retval = bus_create_file(bus, &bus_attr_drivers_probe);
if (retval)
goto out;

bus->drivers_autoprobe_attr.attr.name = "drivers_autoprobe";
bus->drivers_autoprobe_attr.attr.mode = S_IWUSR | S_IRUGO;
bus->drivers_autoprobe_attr.show = show_drivers_autoprobe;
bus->drivers_autoprobe_attr.store = store_drivers_autoprobe;
retval = bus_create_file(bus, &bus->drivers_autoprobe_attr);
retval = bus_create_file(bus, &bus_attr_drivers_autoprobe);
if (retval)
bus_remove_file(bus, &bus->drivers_probe_attr);
bus_remove_file(bus, &bus_attr_drivers_probe);
out:
return retval;
}

static void remove_probe_files(struct bus_type *bus)
{
bus_remove_file(bus, &bus->drivers_autoprobe_attr);
bus_remove_file(bus, &bus->drivers_probe_attr);
bus_remove_file(bus, &bus_attr_drivers_autoprobe);
bus_remove_file(bus, &bus_attr_drivers_probe);
}
#else
static inline int add_bind_files(struct device_driver *drv) { return 0; }
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ struct bus_type {
struct bus_attribute * bus_attrs;
struct device_attribute * dev_attrs;
struct driver_attribute * drv_attrs;
struct bus_attribute drivers_autoprobe_attr;
struct bus_attribute drivers_probe_attr;

int (*match)(struct device * dev, struct device_driver * drv);
int (*uevent)(struct device *dev, char **envp,
Expand Down

0 comments on commit 211ed4a

Please sign in to comment.