[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210528072120.21332-1-yuehaibing@huawei.com>
Date: Fri, 28 May 2021 15:21:20 +0800
From: YueHaibing <yuehaibing@...wei.com>
To: <inki.dae@...sung.com>, <jy0922.shim@...sung.com>,
<sw0312.kim@...sung.com>, <kyungmin.park@...sung.com>,
<airlied@...ux.ie>, <daniel@...ll.ch>,
<krzysztof.kozlowski@...onical.com>, <yuehaibing@...wei.com>
CC: <dri-devel@...ts.freedesktop.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-samsung-soc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] drm/exynos-vidi: use DEVICE_ATTR_RW macro
Use DEVICE_ATTR_RW() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
drivers/gpu/drm/exynos/exynos_drm_vidi.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index e5662bdcbbde..a3a95a2c0bae 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -165,8 +165,8 @@ static void vidi_fake_vblank_timer(struct timer_list *t)
jiffies + msecs_to_jiffies(VIDI_REFRESH_TIME) - 1);
}
-static ssize_t vidi_show_connection(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t connection_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct vidi_context *ctx = dev_get_drvdata(dev);
int rc;
@@ -180,7 +180,7 @@ static ssize_t vidi_show_connection(struct device *dev,
return rc;
}
-static ssize_t vidi_store_connection(struct device *dev,
+static ssize_t connection_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{
@@ -211,8 +211,7 @@ static ssize_t vidi_store_connection(struct device *dev,
return len;
}
-static DEVICE_ATTR(connection, 0644, vidi_show_connection,
- vidi_store_connection);
+static DEVICE_ATTR_RW(connection);
static struct attribute *vidi_attrs[] = {
&dev_attr_connection.attr,
--
2.17.1
Powered by blists - more mailing lists