Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: imon: use DEVICE_ATTR_RW() helper macro

Use DEVICE_ATTR_RW() helper macro instead of DEVICE_ATTR(), which is
simpler and more readable.

Due to the names of the read and write functions of the sysfs attribute is
normalized, there is a natural association.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Zhen Lei and committed by
Mauro Carvalho Chehab
f1d9f315 53a370f6

+6 -9
+6 -9
drivers/media/rc/imon.c
··· 780 780 /* 781 781 * These are the sysfs functions to handle the association on the iMON 2.4G LT. 782 782 */ 783 - static ssize_t show_associate_remote(struct device *d, 783 + static ssize_t associate_remote_show(struct device *d, 784 784 struct device_attribute *attr, 785 785 char *buf) 786 786 { ··· 800 800 return strlen(buf); 801 801 } 802 802 803 - static ssize_t store_associate_remote(struct device *d, 803 + static ssize_t associate_remote_store(struct device *d, 804 804 struct device_attribute *attr, 805 805 const char *buf, size_t count) 806 806 { ··· 822 822 /* 823 823 * sysfs functions to control internal imon clock 824 824 */ 825 - static ssize_t show_imon_clock(struct device *d, 825 + static ssize_t imon_clock_show(struct device *d, 826 826 struct device_attribute *attr, char *buf) 827 827 { 828 828 struct imon_context *ictx = dev_get_drvdata(d); ··· 848 848 return len; 849 849 } 850 850 851 - static ssize_t store_imon_clock(struct device *d, 851 + static ssize_t imon_clock_store(struct device *d, 852 852 struct device_attribute *attr, 853 853 const char *buf, size_t count) 854 854 { ··· 895 895 } 896 896 897 897 898 - static DEVICE_ATTR(imon_clock, S_IWUSR | S_IRUGO, show_imon_clock, 899 - store_imon_clock); 900 - 901 - static DEVICE_ATTR(associate_remote, S_IWUSR | S_IRUGO, show_associate_remote, 902 - store_associate_remote); 898 + static DEVICE_ATTR_RW(imon_clock); 899 + static DEVICE_ATTR_RW(associate_remote); 903 900 904 901 static struct attribute *imon_display_sysfs_entries[] = { 905 902 &dev_attr_imon_clock.attr,