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

media: exynos4-is: 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: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Zhen Lei and committed by
Mauro Carvalho Chehab
e006558f 9256de06

+6 -7
+6 -7
drivers/media/platform/exynos4-is/media-dev.c
··· 1238 1238 .link_notify = fimc_md_link_notify, 1239 1239 }; 1240 1240 1241 - static ssize_t fimc_md_sysfs_show(struct device *dev, 1242 - struct device_attribute *attr, char *buf) 1241 + static ssize_t subdev_conf_mode_show(struct device *dev, 1242 + struct device_attribute *attr, char *buf) 1243 1243 { 1244 1244 struct fimc_md *fmd = dev_get_drvdata(dev); 1245 1245 ··· 1249 1249 return strscpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE); 1250 1250 } 1251 1251 1252 - static ssize_t fimc_md_sysfs_store(struct device *dev, 1253 - struct device_attribute *attr, 1254 - const char *buf, size_t count) 1252 + static ssize_t subdev_conf_mode_store(struct device *dev, 1253 + struct device_attribute *attr, 1254 + const char *buf, size_t count) 1255 1255 { 1256 1256 struct fimc_md *fmd = dev_get_drvdata(dev); 1257 1257 bool subdev_api; ··· 1278 1278 * sub-dev - for media controller API, subdevs must be configured in user 1279 1279 * space before starting streaming. 1280 1280 */ 1281 - static DEVICE_ATTR(subdev_conf_mode, S_IWUSR | S_IRUGO, 1282 - fimc_md_sysfs_show, fimc_md_sysfs_store); 1281 + static DEVICE_ATTR_RW(subdev_conf_mode); 1283 1282 1284 1283 static int cam_clk_prepare(struct clk_hw *hw) 1285 1284 {