diff options
Diffstat (limited to 'drivers/usb/core/endpoint.c')
-rw-r--r-- | drivers/usb/core/endpoint.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index f13a289a0743..39a24021fe4d 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c | |||
@@ -32,31 +32,31 @@ struct ep_attribute { | |||
32 | container_of(_attr, struct ep_attribute, attr) | 32 | container_of(_attr, struct ep_attribute, attr) |
33 | 33 | ||
34 | #define usb_ep_attr(field, format_string) \ | 34 | #define usb_ep_attr(field, format_string) \ |
35 | static ssize_t show_ep_##field(struct device *dev, \ | 35 | static ssize_t field##_show(struct device *dev, \ |
36 | struct device_attribute *attr, \ | 36 | struct device_attribute *attr, \ |
37 | char *buf) \ | 37 | char *buf) \ |
38 | { \ | 38 | { \ |
39 | struct ep_device *ep = to_ep_device(dev); \ | 39 | struct ep_device *ep = to_ep_device(dev); \ |
40 | return sprintf(buf, format_string, ep->desc->field); \ | 40 | return sprintf(buf, format_string, ep->desc->field); \ |
41 | } \ | 41 | } \ |
42 | static DEVICE_ATTR(field, S_IRUGO, show_ep_##field, NULL); | 42 | static DEVICE_ATTR_RO(field) |
43 | 43 | ||
44 | usb_ep_attr(bLength, "%02x\n") | 44 | usb_ep_attr(bLength, "%02x\n"); |
45 | usb_ep_attr(bEndpointAddress, "%02x\n") | 45 | usb_ep_attr(bEndpointAddress, "%02x\n"); |
46 | usb_ep_attr(bmAttributes, "%02x\n") | 46 | usb_ep_attr(bmAttributes, "%02x\n"); |
47 | usb_ep_attr(bInterval, "%02x\n") | 47 | usb_ep_attr(bInterval, "%02x\n"); |
48 | 48 | ||
49 | static ssize_t show_ep_wMaxPacketSize(struct device *dev, | 49 | static ssize_t wMaxPacketSize_show(struct device *dev, |
50 | struct device_attribute *attr, char *buf) | 50 | struct device_attribute *attr, char *buf) |
51 | { | 51 | { |
52 | struct ep_device *ep = to_ep_device(dev); | 52 | struct ep_device *ep = to_ep_device(dev); |
53 | return sprintf(buf, "%04x\n", | 53 | return sprintf(buf, "%04x\n", |
54 | usb_endpoint_maxp(ep->desc) & 0x07ff); | 54 | usb_endpoint_maxp(ep->desc) & 0x07ff); |
55 | } | 55 | } |
56 | static DEVICE_ATTR(wMaxPacketSize, S_IRUGO, show_ep_wMaxPacketSize, NULL); | 56 | static DEVICE_ATTR_RO(wMaxPacketSize); |
57 | 57 | ||
58 | static ssize_t show_ep_type(struct device *dev, struct device_attribute *attr, | 58 | static ssize_t type_show(struct device *dev, struct device_attribute *attr, |
59 | char *buf) | 59 | char *buf) |
60 | { | 60 | { |
61 | struct ep_device *ep = to_ep_device(dev); | 61 | struct ep_device *ep = to_ep_device(dev); |
62 | char *type = "unknown"; | 62 | char *type = "unknown"; |
@@ -77,10 +77,10 @@ static ssize_t show_ep_type(struct device *dev, struct device_attribute *attr, | |||
77 | } | 77 | } |
78 | return sprintf(buf, "%s\n", type); | 78 | return sprintf(buf, "%s\n", type); |
79 | } | 79 | } |
80 | static DEVICE_ATTR(type, S_IRUGO, show_ep_type, NULL); | 80 | static DEVICE_ATTR_RO(type); |
81 | 81 | ||
82 | static ssize_t show_ep_interval(struct device *dev, | 82 | static ssize_t interval_show(struct device *dev, struct device_attribute *attr, |
83 | struct device_attribute *attr, char *buf) | 83 | char *buf) |
84 | { | 84 | { |
85 | struct ep_device *ep = to_ep_device(dev); | 85 | struct ep_device *ep = to_ep_device(dev); |
86 | char unit; | 86 | char unit; |
@@ -123,10 +123,10 @@ static ssize_t show_ep_interval(struct device *dev, | |||
123 | 123 | ||
124 | return sprintf(buf, "%d%cs\n", interval, unit); | 124 | return sprintf(buf, "%d%cs\n", interval, unit); |
125 | } | 125 | } |
126 | static DEVICE_ATTR(interval, S_IRUGO, show_ep_interval, NULL); | 126 | static DEVICE_ATTR_RO(interval); |
127 | 127 | ||
128 | static ssize_t show_ep_direction(struct device *dev, | 128 | static ssize_t direction_show(struct device *dev, struct device_attribute *attr, |
129 | struct device_attribute *attr, char *buf) | 129 | char *buf) |
130 | { | 130 | { |
131 | struct ep_device *ep = to_ep_device(dev); | 131 | struct ep_device *ep = to_ep_device(dev); |
132 | char *direction; | 132 | char *direction; |
@@ -139,7 +139,7 @@ static ssize_t show_ep_direction(struct device *dev, | |||
139 | direction = "out"; | 139 | direction = "out"; |
140 | return sprintf(buf, "%s\n", direction); | 140 | return sprintf(buf, "%s\n", direction); |
141 | } | 141 | } |
142 | static DEVICE_ATTR(direction, S_IRUGO, show_ep_direction, NULL); | 142 | static DEVICE_ATTR_RO(direction); |
143 | 143 | ||
144 | static struct attribute *ep_dev_attrs[] = { | 144 | static struct attribute *ep_dev_attrs[] = { |
145 | &dev_attr_bLength.attr, | 145 | &dev_attr_bLength.attr, |