[PATCH -next] drm/exynos-vidi: use DEVICE_ATTR_RW macro
YueHaibing
yuehaibing at huawei.com
Fri May 28 00:21:20 PDT 2021
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 at huawei.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
More information about the linux-arm-kernel
mailing list