diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-06-03 09:15:29 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-08-04 14:43:50 +0200 |
commit | 5fca4169f5bd8dce5f49123196fb97db52d25a99 (patch) | |
tree | 1626bcf851f4b887c10459f259aeb1eab80e7a68 /drivers/media/i2c/et8ek8 | |
parent | media: mc-device.c: use DEVICE_ATTR_RO() helper macro (diff) | |
download | linux-5fca4169f5bd8dce5f49123196fb97db52d25a99.tar.xz linux-5fca4169f5bd8dce5f49123196fb97db52d25a99.zip |
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>
Diffstat (limited to 'drivers/media/i2c/et8ek8')
-rw-r--r-- | drivers/media/i2c/et8ek8/et8ek8_driver.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/i2c/et8ek8/et8ek8_driver.c b/drivers/media/i2c/et8ek8/et8ek8_driver.c index c7b91c0c03b5..873d614339bb 100644 --- a/drivers/media/i2c/et8ek8/et8ek8_driver.c +++ b/drivers/media/i2c/et8ek8/et8ek8_driver.c @@ -1237,8 +1237,7 @@ out_poweroff: * sysfs attributes */ static ssize_t -et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, - char *buf) +priv_mem_show(struct device *dev, struct device_attribute *attr, char *buf) { struct v4l2_subdev *subdev = dev_get_drvdata(dev); struct et8ek8_sensor *sensor = to_et8ek8_sensor(subdev); @@ -1251,7 +1250,7 @@ et8ek8_priv_mem_read(struct device *dev, struct device_attribute *attr, 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 |