| --- |
| drivers/usb/gadget/function/f_mass_storage.c | 5 - |
| drivers/usb/wusbcore/cbaf.c | 82 +++++++++++---------------- |
| 2 files changed, 38 insertions(+), 49 deletions(-) |
| |
| --- a/drivers/usb/gadget/function/f_mass_storage.c |
| +++ b/drivers/usb/gadget/function/f_mass_storage.c |
| @@ -2545,9 +2545,8 @@ static ssize_t file_store(struct device |
| } |
| |
| static DEVICE_ATTR_RW(nofua); |
| -/* mode wil be set in fsg_lun_attr_is_visible() */ |
| -static DEVICE_ATTR(ro, 0, ro_show, ro_store); |
| -static DEVICE_ATTR(file, 0, file_show, file_store); |
| +static DEVICE_ATTR_RW(ro); |
| +static DEVICE_ATTR_RW(file); |
| |
| /****************************** FSG COMMON ******************************/ |
| |
| --- a/drivers/usb/wusbcore/cbaf.c |
| +++ b/drivers/usb/wusbcore/cbaf.c |
| @@ -296,9 +296,8 @@ static int cbaf_cdid_get(struct cbaf *cb |
| return 0; |
| } |
| |
| -static ssize_t cbaf_wusb_chid_show(struct device *dev, |
| - struct device_attribute *attr, |
| - char *buf) |
| +static ssize_t wusb_chid_show(struct device *dev, struct device_attribute *attr, |
| + char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| @@ -308,9 +307,9 @@ static ssize_t cbaf_wusb_chid_show(struc |
| return scnprintf(buf, PAGE_SIZE, "%s\n", pr_chid); |
| } |
| |
| -static ssize_t cbaf_wusb_chid_store(struct device *dev, |
| - struct device_attribute *attr, |
| - const char *buf, size_t size) |
| +static ssize_t wusb_chid_store(struct device *dev, |
| + struct device_attribute *attr, |
| + const char *buf, size_t size) |
| { |
| ssize_t result; |
| struct usb_interface *iface = to_usb_interface(dev); |
| @@ -341,11 +340,10 @@ static ssize_t cbaf_wusb_chid_store(stru |
| return result; |
| return size; |
| } |
| -static DEVICE_ATTR(wusb_chid, 0600, cbaf_wusb_chid_show, cbaf_wusb_chid_store); |
| +static DEVICE_ATTR_RW(wusb_chid); |
| |
| -static ssize_t cbaf_wusb_host_name_show(struct device *dev, |
| - struct device_attribute *attr, |
| - char *buf) |
| +static ssize_t wusb_host_name_show(struct device *dev, |
| + struct device_attribute *attr, char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| @@ -353,9 +351,9 @@ static ssize_t cbaf_wusb_host_name_show( |
| return scnprintf(buf, PAGE_SIZE, "%s\n", cbaf->host_name); |
| } |
| |
| -static ssize_t cbaf_wusb_host_name_store(struct device *dev, |
| - struct device_attribute *attr, |
| - const char *buf, size_t size) |
| +static ssize_t wusb_host_name_store(struct device *dev, |
| + struct device_attribute *attr, |
| + const char *buf, size_t size) |
| { |
| ssize_t result; |
| struct usb_interface *iface = to_usb_interface(dev); |
| @@ -367,12 +365,11 @@ static ssize_t cbaf_wusb_host_name_store |
| |
| return size; |
| } |
| -static DEVICE_ATTR(wusb_host_name, 0600, cbaf_wusb_host_name_show, |
| - cbaf_wusb_host_name_store); |
| +static DEVICE_ATTR_RW(wusb_host_name); |
| |
| -static ssize_t cbaf_wusb_host_band_groups_show(struct device *dev, |
| - struct device_attribute *attr, |
| - char *buf) |
| +static ssize_t wusb_host_band_groups_show(struct device *dev, |
| + struct device_attribute *attr, |
| + char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| @@ -380,9 +377,9 @@ static ssize_t cbaf_wusb_host_band_group |
| return scnprintf(buf, PAGE_SIZE, "0x%04x\n", cbaf->host_band_groups); |
| } |
| |
| -static ssize_t cbaf_wusb_host_band_groups_store(struct device *dev, |
| - struct device_attribute *attr, |
| - const char *buf, size_t size) |
| +static ssize_t wusb_host_band_groups_store(struct device *dev, |
| + struct device_attribute *attr, |
| + const char *buf, size_t size) |
| { |
| ssize_t result; |
| struct usb_interface *iface = to_usb_interface(dev); |
| @@ -397,10 +394,7 @@ static ssize_t cbaf_wusb_host_band_group |
| |
| return size; |
| } |
| - |
| -static DEVICE_ATTR(wusb_host_band_groups, 0600, |
| - cbaf_wusb_host_band_groups_show, |
| - cbaf_wusb_host_band_groups_store); |
| +static DEVICE_ATTR_RW(wusb_host_band_groups); |
| |
| static const struct wusb_cbaf_device_info cbaf_device_info_defaults = { |
| .Length_hdr = WUSB_AR_Length, |
| @@ -410,8 +404,8 @@ static const struct wusb_cbaf_device_inf |
| .DeviceFriendlyName_hdr = WUSB_AR_DeviceFriendlyName, |
| }; |
| |
| -static ssize_t cbaf_wusb_cdid_show(struct device *dev, |
| - struct device_attribute *attr, char *buf) |
| +static ssize_t wusb_cdid_show(struct device *dev, struct device_attribute *attr, |
| + char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| @@ -421,9 +415,9 @@ static ssize_t cbaf_wusb_cdid_show(struc |
| return scnprintf(buf, PAGE_SIZE, "%s\n", pr_cdid); |
| } |
| |
| -static ssize_t cbaf_wusb_cdid_store(struct device *dev, |
| - struct device_attribute *attr, |
| - const char *buf, size_t size) |
| +static ssize_t wusb_cdid_store(struct device *dev, |
| + struct device_attribute *attr, const char *buf, |
| + size_t size) |
| { |
| ssize_t result; |
| struct usb_interface *iface = to_usb_interface(dev); |
| @@ -450,32 +444,28 @@ static ssize_t cbaf_wusb_cdid_store(stru |
| |
| return size; |
| } |
| -static DEVICE_ATTR(wusb_cdid, 0600, cbaf_wusb_cdid_show, cbaf_wusb_cdid_store); |
| +static DEVICE_ATTR_RW(wusb_cdid); |
| |
| -static ssize_t cbaf_wusb_device_band_groups_show(struct device *dev, |
| - struct device_attribute *attr, |
| - char *buf) |
| +static ssize_t wusb_device_band_groups_show(struct device *dev, |
| + struct device_attribute *attr, |
| + char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| |
| return scnprintf(buf, PAGE_SIZE, "0x%04x\n", cbaf->device_band_groups); |
| } |
| +static DEVICE_ATTR_RO(wusb_device_band_groups); |
| |
| -static DEVICE_ATTR(wusb_device_band_groups, 0600, |
| - cbaf_wusb_device_band_groups_show, |
| - NULL); |
| - |
| -static ssize_t cbaf_wusb_device_name_show(struct device *dev, |
| - struct device_attribute *attr, |
| - char *buf) |
| +static ssize_t wusb_device_name_show(struct device *dev, |
| + struct device_attribute *attr, char *buf) |
| { |
| struct usb_interface *iface = to_usb_interface(dev); |
| struct cbaf *cbaf = usb_get_intfdata(iface); |
| |
| return scnprintf(buf, PAGE_SIZE, "%s\n", cbaf->device_name); |
| } |
| -static DEVICE_ATTR(wusb_device_name, 0600, cbaf_wusb_device_name_show, NULL); |
| +static DEVICE_ATTR_RO(wusb_device_name); |
| |
| static const struct wusb_cbaf_cc_data cbaf_cc_data_defaults = { |
| .AssociationTypeId_hdr = WUSB_AR_AssociationTypeId, |
| @@ -529,9 +519,9 @@ static int cbaf_cc_upload(struct cbaf *c |
| return result; |
| } |
| |
| -static ssize_t cbaf_wusb_ck_store(struct device *dev, |
| - struct device_attribute *attr, |
| - const char *buf, size_t size) |
| +static ssize_t wusb_ck_store(struct device *dev, |
| + struct device_attribute *attr, |
| + const char *buf, size_t size) |
| { |
| ssize_t result; |
| struct usb_interface *iface = to_usb_interface(dev); |
| @@ -559,7 +549,7 @@ static ssize_t cbaf_wusb_ck_store(struct |
| |
| return size; |
| } |
| -static DEVICE_ATTR(wusb_ck, 0600, NULL, cbaf_wusb_ck_store); |
| +static DEVICE_ATTR_WO(wusb_ck); |
| |
| static struct attribute *cbaf_dev_attrs[] = { |
| &dev_attr_wusb_host_name.attr, |