diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/bus.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 15 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/iuu_phoenix.c | 8 |
4 files changed, 14 insertions, 22 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index f053b302a00d..0ce51f21ed2a 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 | ||
41 | static ssize_t show_port_number(struct device *dev, | 41 | static 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 | 48 | static DEVICE_ATTR_RO(port_number); | |
49 | static DEVICE_ATTR(port_number, S_IRUGO, show_port_number, NULL); | ||
50 | 49 | ||
51 | static int usb_serial_device_probe(struct device *dev) | 50 | static int usb_serial_device_probe(struct device *dev) |
52 | { | 51 | { |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index dbf2f2818823..c45f9c0a1b34 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1561,8 +1561,8 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port) | |||
1561 | * *************************************************************************** | 1561 | * *************************************************************************** |
1562 | */ | 1562 | */ |
1563 | 1563 | ||
1564 | static ssize_t show_latency_timer(struct device *dev, | 1564 | static ssize_t latency_timer_show(struct device *dev, |
1565 | struct device_attribute *attr, char *buf) | 1565 | struct device_attribute *attr, char *buf) |
1566 | { | 1566 | { |
1567 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1567 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1568 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1568 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
@@ -1572,11 +1572,10 @@ static ssize_t show_latency_timer(struct device *dev, | |||
1572 | return sprintf(buf, "%i\n", priv->latency); | 1572 | return sprintf(buf, "%i\n", priv->latency); |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | |||
1576 | /* Write a new value of the latency timer, in units of milliseconds. */ | 1575 | /* Write a new value of the latency timer, in units of milliseconds. */ |
1577 | static ssize_t store_latency_timer(struct device *dev, | 1576 | static ssize_t latency_timer_store(struct device *dev, |
1578 | struct device_attribute *attr, const char *valbuf, | 1577 | struct device_attribute *attr, |
1579 | size_t count) | 1578 | const char *valbuf, size_t count) |
1580 | { | 1579 | { |
1581 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1580 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1582 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1581 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
@@ -1589,6 +1588,7 @@ static ssize_t store_latency_timer(struct device *dev, | |||
1589 | return -EIO; | 1588 | return -EIO; |
1590 | return count; | 1589 | return count; |
1591 | } | 1590 | } |
1591 | static DEVICE_ATTR_RW(latency_timer); | ||
1592 | 1592 | ||
1593 | /* Write an event character directly to the FTDI register. The ASCII | 1593 | /* Write an event character directly to the FTDI register. The ASCII |
1594 | value is in the low 8 bits, with the enable bit in the 9th bit. */ | 1594 | value is in the low 8 bits, with the enable bit in the 9th bit. */ |
@@ -1616,9 +1616,6 @@ static ssize_t store_event_char(struct device *dev, | |||
1616 | 1616 | ||
1617 | return count; | 1617 | return count; |
1618 | } | 1618 | } |
1619 | |||
1620 | static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, | ||
1621 | store_latency_timer); | ||
1622 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); | 1619 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); |
1623 | 1620 | ||
1624 | static int create_sysfs_attrs(struct usb_serial_port *port) | 1621 | static int create_sysfs_attrs(struct usb_serial_port *port) |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 9c18f5985c8d..b7187bf32469 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2484,7 +2484,7 @@ static int edge_port_remove(struct usb_serial_port *port) | |||
2484 | 2484 | ||
2485 | /* Sysfs Attributes */ | 2485 | /* Sysfs Attributes */ |
2486 | 2486 | ||
2487 | static ssize_t show_uart_mode(struct device *dev, | 2487 | static ssize_t uart_mode_show(struct device *dev, |
2488 | struct device_attribute *attr, char *buf) | 2488 | struct device_attribute *attr, char *buf) |
2489 | { | 2489 | { |
2490 | struct usb_serial_port *port = to_usb_serial_port(dev); | 2490 | struct usb_serial_port *port = to_usb_serial_port(dev); |
@@ -2493,7 +2493,7 @@ static ssize_t show_uart_mode(struct device *dev, | |||
2493 | return sprintf(buf, "%d\n", edge_port->bUartMode); | 2493 | return sprintf(buf, "%d\n", edge_port->bUartMode); |
2494 | } | 2494 | } |
2495 | 2495 | ||
2496 | static ssize_t store_uart_mode(struct device *dev, | 2496 | static ssize_t uart_mode_store(struct device *dev, |
2497 | struct device_attribute *attr, const char *valbuf, size_t count) | 2497 | struct device_attribute *attr, const char *valbuf, size_t count) |
2498 | { | 2498 | { |
2499 | struct usb_serial_port *port = to_usb_serial_port(dev); | 2499 | struct usb_serial_port *port = to_usb_serial_port(dev); |
@@ -2509,9 +2509,7 @@ static ssize_t store_uart_mode(struct device *dev, | |||
2509 | 2509 | ||
2510 | return count; | 2510 | return count; |
2511 | } | 2511 | } |
2512 | 2512 | static DEVICE_ATTR_RW(uart_mode); | |
2513 | static DEVICE_ATTR(uart_mode, S_IWUSR | S_IRUGO, show_uart_mode, | ||
2514 | store_uart_mode); | ||
2515 | 2513 | ||
2516 | static int edge_create_sysfs_attrs(struct usb_serial_port *port) | 2514 | static int edge_create_sysfs_attrs(struct usb_serial_port *port) |
2517 | { | 2515 | { |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 790673e5faa7..57c439a24b5a 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -1130,7 +1130,7 @@ static int iuu_vcc_set(struct usb_serial_port *port, unsigned int vcc) | |||
1130 | * Sysfs Attributes | 1130 | * Sysfs Attributes |
1131 | */ | 1131 | */ |
1132 | 1132 | ||
1133 | static ssize_t show_vcc_mode(struct device *dev, | 1133 | static ssize_t vcc_mode_show(struct device *dev, |
1134 | struct device_attribute *attr, char *buf) | 1134 | struct device_attribute *attr, char *buf) |
1135 | { | 1135 | { |
1136 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1136 | struct usb_serial_port *port = to_usb_serial_port(dev); |
@@ -1139,7 +1139,7 @@ static ssize_t show_vcc_mode(struct device *dev, | |||
1139 | return sprintf(buf, "%d\n", priv->vcc); | 1139 | return sprintf(buf, "%d\n", priv->vcc); |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static ssize_t store_vcc_mode(struct device *dev, | 1142 | static ssize_t vcc_mode_store(struct device *dev, |
1143 | struct device_attribute *attr, const char *buf, size_t count) | 1143 | struct device_attribute *attr, const char *buf, size_t count) |
1144 | { | 1144 | { |
1145 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1145 | struct usb_serial_port *port = to_usb_serial_port(dev); |
@@ -1163,9 +1163,7 @@ static ssize_t store_vcc_mode(struct device *dev, | |||
1163 | fail_store_vcc_mode: | 1163 | fail_store_vcc_mode: |
1164 | return count; | 1164 | return count; |
1165 | } | 1165 | } |
1166 | 1166 | static DEVICE_ATTR_RW(vcc_mode); | |
1167 | static DEVICE_ATTR(vcc_mode, S_IRUSR | S_IWUSR, show_vcc_mode, | ||
1168 | store_vcc_mode); | ||
1169 | 1167 | ||
1170 | static int iuu_create_sysfs_attrs(struct usb_serial_port *port) | 1168 | static int iuu_create_sysfs_attrs(struct usb_serial_port *port) |
1171 | { | 1169 | { |