serial: 8250_port: Switch to use DEVICE_ATTR_RW()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Feb 2020 11:40:13 +0000 (13:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2020 10:38:58 +0000 (11:38 +0100)
Move device attributes to DEVICE_ATTR_RW() as that would make things
a lot more "obvious" what is happening here.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200217114016.49856-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c

index 430e346..df2b2f6 100644 (file)
@@ -2876,7 +2876,7 @@ static int do_serial8250_get_rxtrig(struct tty_port *port)
        return rxtrig_bytes;
 }
 
-static ssize_t serial8250_get_attr_rx_trig_bytes(struct device *dev,
+static ssize_t rx_trig_bytes_show(struct device *dev,
        struct device_attribute *attr, char *buf)
 {
        struct tty_port *port = dev_get_drvdata(dev);
@@ -2922,7 +2922,7 @@ static int do_serial8250_set_rxtrig(struct tty_port *port, unsigned char bytes)
        return ret;
 }
 
-static ssize_t serial8250_set_attr_rx_trig_bytes(struct device *dev,
+static ssize_t rx_trig_bytes_store(struct device *dev,
        struct device_attribute *attr, const char *buf, size_t count)
 {
        struct tty_port *port = dev_get_drvdata(dev);
@@ -2943,18 +2943,16 @@ static ssize_t serial8250_set_attr_rx_trig_bytes(struct device *dev,
        return count;
 }
 
-static DEVICE_ATTR(rx_trig_bytes, S_IRUSR | S_IWUSR | S_IRGRP,
-                  serial8250_get_attr_rx_trig_bytes,
-                  serial8250_set_attr_rx_trig_bytes);
+static DEVICE_ATTR_RW(rx_trig_bytes);
 
 static struct attribute *serial8250_dev_attrs[] = {
        &dev_attr_rx_trig_bytes.attr,
-       NULL,
-       };
+       NULL
+};
 
 static struct attribute_group serial8250_dev_attr_group = {
        .attrs = serial8250_dev_attrs,
-       };
+};
 
 static void register_dev_spec_attr_grp(struct uart_8250_port *up)
 {