USB: musb: fix up one odd DEVICE_ATTR() usage
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jan 2018 10:24:09 +0000 (11:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jan 2018 07:49:52 +0000 (08:49 +0100)
It really should be DEVICE_ATTR_WO(), no need to "open code" it.

Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_core.c

index f4f2693608e637a061b3aa96fcfdd3965ba3c3d1..968bf1e8b0fed683f76563eddbe8d841a920e395 100644 (file)
@@ -1778,8 +1778,7 @@ static DEVICE_ATTR_RW(vbus);
 /* Gadget drivers can't know that a host is connected so they might want
  * to start SRP, but users can.  This allows userspace to trigger SRP.
  */
-static ssize_t
-musb_srp_store(struct device *dev, struct device_attribute *attr,
+static ssize_t srp_store(struct device *dev, struct device_attribute *attr,
                const char *buf, size_t n)
 {
        struct musb     *musb = dev_to_musb(dev);
@@ -1796,7 +1795,7 @@ musb_srp_store(struct device *dev, struct device_attribute *attr,
 
        return n;
 }
-static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store);
+static DEVICE_ATTR_WO(srp);
 
 static struct attribute *musb_attributes[] = {
        &dev_attr_mode.attr,