aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/bus.c')
-rw-r--r--drivers/usb/serial/bus.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index f053b302a00d..6335490d5760 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -38,15 +38,14 @@ static int usb_serial_device_match(struct device *dev,
38 return 0; 38 return 0;
39} 39}
40 40
41static ssize_t show_port_number(struct device *dev, 41static ssize_t port_number_show(struct device *dev,
42 struct device_attribute *attr, char *buf) 42 struct device_attribute *attr, char *buf)
43{ 43{
44 struct usb_serial_port *port = to_usb_serial_port(dev); 44 struct usb_serial_port *port = to_usb_serial_port(dev);
45 45
46 return sprintf(buf, "%d\n", port->port_number); 46 return sprintf(buf, "%d\n", port->port_number);
47} 47}
48 48static DEVICE_ATTR_RO(port_number);
49static DEVICE_ATTR(port_number, S_IRUGO, show_port_number, NULL);
50 49
51static int usb_serial_device_probe(struct device *dev) 50static int usb_serial_device_probe(struct device *dev)
52{ 51{
@@ -122,7 +121,7 @@ static int usb_serial_device_remove(struct device *dev)
122 return retval; 121 return retval;
123} 122}
124 123
125static ssize_t store_new_id(struct device_driver *driver, 124static ssize_t new_id_store(struct device_driver *driver,
126 const char *buf, size_t count) 125 const char *buf, size_t count)
127{ 126{
128 struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); 127 struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
@@ -135,17 +134,19 @@ static ssize_t store_new_id(struct device_driver *driver,
135 return retval; 134 return retval;
136} 135}
137 136
138static ssize_t show_dynids(struct device_driver *driver, char *buf) 137static ssize_t new_id_show(struct device_driver *driver, char *buf)
139{ 138{
140 struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); 139 struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
141 140
142 return usb_show_dynids(&usb_drv->dynids, buf); 141 return usb_show_dynids(&usb_drv->dynids, buf);
143} 142}
143static DRIVER_ATTR_RW(new_id);
144 144
145static struct driver_attribute drv_attrs[] = { 145static struct attribute *usb_serial_drv_attrs[] = {
146 __ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id), 146 &driver_attr_new_id.attr,
147 __ATTR_NULL, 147 NULL,
148}; 148};
149ATTRIBUTE_GROUPS(usb_serial_drv);
149 150
150static void free_dynids(struct usb_serial_driver *drv) 151static void free_dynids(struct usb_serial_driver *drv)
151{ 152{
@@ -164,7 +165,7 @@ struct bus_type usb_serial_bus_type = {
164 .match = usb_serial_device_match, 165 .match = usb_serial_device_match,
165 .probe = usb_serial_device_probe, 166 .probe = usb_serial_device_probe,
166 .remove = usb_serial_device_remove, 167 .remove = usb_serial_device_remove,
167 .drv_attrs = drv_attrs, 168 .drv_groups = usb_serial_drv_groups,
168}; 169};
169 170
170int usb_serial_bus_register(struct usb_serial_driver *driver) 171int usb_serial_bus_register(struct usb_serial_driver *driver)