From ed5bd7a47fd77166860e39f857ae8e3fe25c836c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 23 Jan 2018 11:24:05 +0100 Subject: USB: move many drivers to use DEVICE_ATTR_RW Instead of "open coding" a DEVICE_ATTR() define, use the DEVICE_ATTR_RW() macro instead, which does everything properly instead. This does require a few static functions to be renamed to work properly, but thanks to a script from Joe Perches, this was easily done. Reported-by: Joe Perches Cc: Matthieu CASTET Cc: Stanislaw Gruszka Cc: Peter Chen Cc: Mathias Nyman Acked-by: Felipe Balbi Acked-by: Alan Stern Acked-by: Bin Liu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/musb_core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/usb/musb') diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ea5013aa69e2..f4f2693608e6 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1687,7 +1687,7 @@ EXPORT_SYMBOL_GPL(musb_mailbox); /*-------------------------------------------------------------------------*/ static ssize_t -musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) +mode_show(struct device *dev, struct device_attribute *attr, char *buf) { struct musb *musb = dev_to_musb(dev); unsigned long flags; @@ -1701,7 +1701,7 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf) } static ssize_t -musb_mode_store(struct device *dev, struct device_attribute *attr, +mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct musb *musb = dev_to_musb(dev); @@ -1721,10 +1721,10 @@ musb_mode_store(struct device *dev, struct device_attribute *attr, return (status == 0) ? n : status; } -static DEVICE_ATTR(mode, 0644, musb_mode_show, musb_mode_store); +static DEVICE_ATTR_RW(mode); static ssize_t -musb_vbus_store(struct device *dev, struct device_attribute *attr, +vbus_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct musb *musb = dev_to_musb(dev); @@ -1748,7 +1748,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr, } static ssize_t -musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) +vbus_show(struct device *dev, struct device_attribute *attr, char *buf) { struct musb *musb = dev_to_musb(dev); unsigned long flags; @@ -1773,7 +1773,7 @@ musb_vbus_show(struct device *dev, struct device_attribute *attr, char *buf) return sprintf(buf, "Vbus %s, timeout %lu msec\n", vbus ? "on" : "off", val); } -static DEVICE_ATTR(vbus, 0644, musb_vbus_show, musb_vbus_store); +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. -- cgit v1.2.3