mfd: timberdale: Use DEVICE_ATTR_RO macro
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 2 Jun 2021 11:43:33 +0000 (19:43 +0800)
committerLee Jones <lee.jones@linaro.org>
Tue, 15 Jun 2021 12:02:18 +0000 (13:02 +0100)
Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes
the code a bit shorter and easier to read.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/timberdale.c

index faecbca6dba3dc0418ad0ad017b91e0a826daf0c..9393ee60a656cd426c31bd195a49454075527a5c 100644 (file)
@@ -623,8 +623,8 @@ static const struct mfd_cell timberdale_cells_bar2[] = {
        },
 };
 
-static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
-       char *buf)
+static ssize_t fw_ver_show(struct device *dev,
+                          struct device_attribute *attr, char *buf)
 {
        struct timberdale_device *priv = dev_get_drvdata(dev);
 
@@ -632,7 +632,7 @@ static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
                priv->fw.config);
 }
 
-static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR_RO(fw_ver);
 
 /*--------------------------------------------------------------------------*/