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

media: i2c: et8ek8: use DEVICE_ATTR_RO() helper macro

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

Due to the name of the read function of the sysfs attribute is normalized,
there is a natural association.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
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
5fca4169 7b537f29

+2 -3
+2 -3
drivers/media/i2c/et8ek8/et8ek8_driver.c
··· 1237 1237 * sysfs attributes 1238 1238 */ 1239 1239 static ssize_t 1240 - et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, 1241 - char *buf) 1240 + priv_mem_show(struct device *dev, struct device_attribute *attr, char *buf) 1242 1241 { 1243 1242 struct v4l2_subdev *subdev = dev_get_drvdata(dev); 1244 1243 struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); ··· 1250 1251 1251 1252 return ET8EK8_PRIV_MEM_SIZE; 1252 1253 } 1253 - static DEVICE_ATTR(priv_mem, 0444, et8ek8_priv_mem_read, NULL); 1254 + static DEVICE_ATTR_RO(priv_mem); 1254 1255 1255 1256 /* -------------------------------------------------------------------------- 1256 1257 * V4L2 subdev core operations