Commit 5fca4169 authored by Zhen Lei's avatar Zhen Lei Committed by Mauro Carvalho Chehab

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: default avatarZhen Lei <thunder.leizhen@huawei.com>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7b537f29
...@@ -1237,8 +1237,7 @@ static int et8ek8_dev_init(struct v4l2_subdev *subdev) ...@@ -1237,8 +1237,7 @@ static int et8ek8_dev_init(struct v4l2_subdev *subdev)
* sysfs attributes * sysfs attributes
*/ */
static ssize_t static ssize_t
et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, priv_mem_show(struct device *dev, struct device_attribute *attr, char *buf)
char *buf)
{ {
struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct v4l2_subdev *subdev = dev_get_drvdata(dev);
struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev);
...@@ -1251,7 +1250,7 @@ et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, ...@@ -1251,7 +1250,7 @@ et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr,
return ET8EK8_PRIV_MEM_SIZE; return ET8EK8_PRIV_MEM_SIZE;
} }
static DEVICE_ATTR(priv_mem, 0444, et8ek8_priv_mem_read, NULL); static DEVICE_ATTR_RO(priv_mem);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* V4L2 subdev core operations * V4L2 subdev core operations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment