Merge tag 'perf-core-for-mingo-4.21-20190104' of git://git.kernel.org/pub/scm/linux...
[sfrench/cifs-2.6.git] / drivers / base / bus.c
index 8bfd27ec73d60d1d18a43f9bfcff29b4eb9a50a6..e06a57936cc969b7de81b00efce504a4185dbc99 100644 (file)
@@ -31,6 +31,9 @@ static struct kset *system_kset;
 
 #define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr)
 
+#define DRIVER_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
+       struct driver_attribute driver_attr_##_name =           \
+               __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
 
 static int __must_check bus_rescan_devices_helper(struct device *dev,
                                                void *data);
@@ -195,7 +198,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,
        bus_put(bus);
        return err;
 }
-static DRIVER_ATTR_WO(unbind);
+static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store);
 
 /*
  * Manually attach a device to a driver.
@@ -231,7 +234,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
        bus_put(bus);
        return err;
 }
-static DRIVER_ATTR_WO(bind);
+static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store);
 
 static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf)
 {
@@ -611,8 +614,10 @@ static void remove_probe_files(struct bus_type *bus)
 static ssize_t uevent_store(struct device_driver *drv, const char *buf,
                            size_t count)
 {
-       kobject_synth_uevent(&drv->p->kobj, buf, count);
-       return count;
+       int rc;
+
+       rc = kobject_synth_uevent(&drv->p->kobj, buf, count);
+       return rc ? rc : count;
 }
 static DRIVER_ATTR_WO(uevent);
 
@@ -828,8 +833,10 @@ static void klist_devices_put(struct klist_node *n)
 static ssize_t bus_uevent_store(struct bus_type *bus,
                                const char *buf, size_t count)
 {
-       kobject_synth_uevent(&bus->p->subsys.kobj, buf, count);
-       return count;
+       int rc;
+
+       rc = kobject_synth_uevent(&bus->p->subsys.kobj, buf, count);
+       return rc ? rc : count;
 }
 static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store);