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>
This commit is contained in:
Zhen Lei 2021-06-03 09:06:13 +02:00 committed by Mauro Carvalho Chehab
parent 9256de0694
commit e006558fa4
1 changed files with 6 additions and 7 deletions

View File

@ -1238,8 +1238,8 @@ static const struct media_device_ops fimc_md_ops = {
.link_notify = fimc_md_link_notify,
};
static ssize_t fimc_md_sysfs_show(struct device *dev,
struct device_attribute *attr, char *buf)
static ssize_t subdev_conf_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct fimc_md *fmd = dev_get_drvdata(dev);
@ -1249,9 +1249,9 @@ static ssize_t fimc_md_sysfs_show(struct device *dev,
return strscpy(buf, "V4L2 video node only API (vid-dev)\n", PAGE_SIZE);
}
static ssize_t fimc_md_sysfs_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
static ssize_t subdev_conf_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fimc_md *fmd = dev_get_drvdata(dev);
bool subdev_api;
@ -1278,8 +1278,7 @@ static ssize_t fimc_md_sysfs_store(struct device *dev,
* sub-dev - for media controller API, subdevs must be configured in user
* space before starting streaming.
*/
static DEVICE_ATTR(subdev_conf_mode, S_IWUSR | S_IRUGO,
fimc_md_sysfs_show, fimc_md_sysfs_store);
static DEVICE_ATTR_RW(subdev_conf_mode);
static int cam_clk_prepare(struct clk_hw *hw)
{