mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
tty: vcc: use DEVICE_ATTR_*() macro
Use DEVICE_ATTR_*() macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/20210602014839.10587-1-thunder.leizhen@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3b2cd60689
commit
2877389f59
1 changed files with 8 additions and 8 deletions
|
@ -473,7 +473,7 @@ static struct vio_version vcc_versions[] = {
|
||||||
|
|
||||||
static struct tty_port_operations vcc_port_ops = { 0 };
|
static struct tty_port_operations vcc_port_ops = { 0 };
|
||||||
|
|
||||||
static ssize_t vcc_sysfs_domain_show(struct device *dev,
|
static ssize_t domain_show(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
{
|
{
|
||||||
|
@ -505,7 +505,7 @@ static int vcc_send_ctl(struct vcc_port *port, int ctl)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t vcc_sysfs_break_store(struct device *dev,
|
static ssize_t break_store(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
const char *buf, size_t count)
|
const char *buf, size_t count)
|
||||||
{
|
{
|
||||||
|
@ -530,8 +530,8 @@ static ssize_t vcc_sysfs_break_store(struct device *dev,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR(domain, 0400, vcc_sysfs_domain_show, NULL);
|
static DEVICE_ATTR_ADMIN_RO(domain);
|
||||||
static DEVICE_ATTR(break, 0200, NULL, vcc_sysfs_break_store);
|
static DEVICE_ATTR_WO(break);
|
||||||
|
|
||||||
static struct attribute *vcc_sysfs_entries[] = {
|
static struct attribute *vcc_sysfs_entries[] = {
|
||||||
&dev_attr_domain.attr,
|
&dev_attr_domain.attr,
|
||||||
|
|
Loading…
Reference in a new issue