From ca35910a1ba21e45368640ac4d884536649966d9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 23 Jan 2018 11:24:07 +0100 Subject: USB: move many drivers to use DEVICE_ATTR_WO Instead of "open coding" a DEVICE_ATTR() define, use the DEVICE_ATTR_WO() 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: Peter Chen Cc: Valentina Manea Acked-by: Felipe Balbi Acked-by: Johan Hovold Acked-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/usb/gadget/udc/core.c') diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index ac0541529499..859d5b11ba4c 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -1417,7 +1417,7 @@ EXPORT_SYMBOL_GPL(usb_gadget_unregister_driver); /* ------------------------------------------------------------------------- */ -static ssize_t usb_udc_srp_store(struct device *dev, +static ssize_t srp_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct usb_udc *udc = container_of(dev, struct usb_udc, dev); @@ -1427,9 +1427,9 @@ static ssize_t usb_udc_srp_store(struct device *dev, return n; } -static DEVICE_ATTR(srp, S_IWUSR, NULL, usb_udc_srp_store); +static DEVICE_ATTR_WO(srp); -static ssize_t usb_udc_softconn_store(struct device *dev, +static ssize_t soft_connect_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) { struct usb_udc *udc = container_of(dev, struct usb_udc, dev); @@ -1453,7 +1453,7 @@ static ssize_t usb_udc_softconn_store(struct device *dev, return n; } -static DEVICE_ATTR(soft_connect, S_IWUSR, NULL, usb_udc_softconn_store); +static DEVICE_ATTR_WO(soft_connect); static ssize_t state_show(struct device *dev, struct device_attribute *attr, char *buf) -- cgit v1.2.3