Commit 567a0e17 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman
Browse files

serial: 8250_port: Switch to use DEVICE_ATTR_RW()



Move device attributes to DEVICE_ATTR_RW() as that would make things
a lot more "obvious" what is happening here.

Suggested-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200217114016.49856-4-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 47eff47c
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -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,13 +2943,11 @@ 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 = {