diff options
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 61c67526a656..ff850d1b0d92 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -568,32 +568,29 @@ static void remove_bind_files(struct device_driver *drv) | |||
568 | driver_remove_file(drv, &driver_attr_unbind); | 568 | driver_remove_file(drv, &driver_attr_unbind); |
569 | } | 569 | } |
570 | 570 | ||
571 | static BUS_ATTR(drivers_probe, S_IWUSR, NULL, store_drivers_probe); | ||
572 | static BUS_ATTR(drivers_autoprobe, S_IWUSR | S_IRUGO, | ||
573 | show_drivers_autoprobe, store_drivers_autoprobe); | ||
574 | |||
571 | static int add_probe_files(struct bus_type *bus) | 575 | static int add_probe_files(struct bus_type *bus) |
572 | { | 576 | { |
573 | int retval; | 577 | int retval; |
574 | 578 | ||
575 | bus->drivers_probe_attr.attr.name = "drivers_probe"; | 579 | retval = bus_create_file(bus, &bus_attr_drivers_probe); |
576 | bus->drivers_probe_attr.attr.mode = S_IWUSR; | ||
577 | bus->drivers_probe_attr.store = store_drivers_probe; | ||
578 | retval = bus_create_file(bus, &bus->drivers_probe_attr); | ||
579 | if (retval) | 580 | if (retval) |
580 | goto out; | 581 | goto out; |
581 | 582 | ||
582 | bus->drivers_autoprobe_attr.attr.name = "drivers_autoprobe"; | 583 | retval = bus_create_file(bus, &bus_attr_drivers_autoprobe); |
583 | bus->drivers_autoprobe_attr.attr.mode = S_IWUSR | S_IRUGO; | ||
584 | bus->drivers_autoprobe_attr.show = show_drivers_autoprobe; | ||
585 | bus->drivers_autoprobe_attr.store = store_drivers_autoprobe; | ||
586 | retval = bus_create_file(bus, &bus->drivers_autoprobe_attr); | ||
587 | if (retval) | 584 | if (retval) |
588 | bus_remove_file(bus, &bus->drivers_probe_attr); | 585 | bus_remove_file(bus, &bus_attr_drivers_probe); |
589 | out: | 586 | out: |
590 | return retval; | 587 | return retval; |
591 | } | 588 | } |
592 | 589 | ||
593 | static void remove_probe_files(struct bus_type *bus) | 590 | static void remove_probe_files(struct bus_type *bus) |
594 | { | 591 | { |
595 | bus_remove_file(bus, &bus->drivers_autoprobe_attr); | 592 | bus_remove_file(bus, &bus_attr_drivers_autoprobe); |
596 | bus_remove_file(bus, &bus->drivers_probe_attr); | 593 | bus_remove_file(bus, &bus_attr_drivers_probe); |
597 | } | 594 | } |
598 | #else | 595 | #else |
599 | static inline int add_bind_files(struct device_driver *drv) { return 0; } | 596 | static inline int add_bind_files(struct device_driver *drv) { return 0; } |