Commit 7b537f29 authored by Zhen Lei's avatar Zhen Lei Committed by Mauro Carvalho Chehab

media: mc-device.c: 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>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 1536fbdb
...@@ -556,7 +556,7 @@ static const struct media_file_operations media_device_fops = { ...@@ -556,7 +556,7 @@ static const struct media_file_operations media_device_fops = {
* sysfs * sysfs
*/ */
static ssize_t show_model(struct device *cd, static ssize_t model_show(struct device *cd,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct media_devnode *devnode = to_media_devnode(cd); struct media_devnode *devnode = to_media_devnode(cd);
...@@ -565,7 +565,7 @@ static ssize_t show_model(struct device *cd, ...@@ -565,7 +565,7 @@ static ssize_t show_model(struct device *cd,
return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model); return sprintf(buf, "%.*s\n", (int)sizeof(mdev->model), mdev->model);
} }
static DEVICE_ATTR(model, S_IRUGO, show_model, NULL); static DEVICE_ATTR_RO(model);
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Registration/unregistration * Registration/unregistration
......
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