summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-10-16 13:49:51 +0300
committerLee Jones <lee@kernel.org>2024-10-31 14:58:50 +0000
commit1f9e418aafc6ee52aad25b85f1e799f031f8de67 (patch)
tree80c8fb92eac2aab695f17281c50d95321230fae4 /drivers/mfd
parentf2be0c3a9584b1a28c06692d4fc52a8a3586c6ab (diff)
downloadlwn-1f9e418aafc6ee52aad25b85f1e799f031f8de67.tar.gz
lwn-1f9e418aafc6ee52aad25b85f1e799f031f8de67.zip
mfd: intel_soc_pmic_bxtwc: Switch to use ATTRIBUTE_GROUPS()
Embrace ATTRIBUTE_GROUPS() to avoid boiler plate code. While at it, move DEVICE_ATTR_ADMIN_RW() closer to the callbacks. This should not introduce any functional changes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20241016105201.757024-2-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/intel_soc_pmic_bxtwc.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index b7204072e93e..c130734f308e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -364,6 +364,7 @@ static ssize_t addr_store(struct device *dev,
return count;
}
+static DEVICE_ATTR_ADMIN_RW(addr);
static ssize_t val_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -400,23 +401,14 @@ static ssize_t val_store(struct device *dev,
}
return count;
}
-
-static DEVICE_ATTR_ADMIN_RW(addr);
static DEVICE_ATTR_ADMIN_RW(val);
+
static struct attribute *bxtwc_attrs[] = {
&dev_attr_addr.attr,
&dev_attr_val.attr,
NULL
};
-
-static const struct attribute_group bxtwc_group = {
- .attrs = bxtwc_attrs,
-};
-
-static const struct attribute_group *bxtwc_groups[] = {
- &bxtwc_group,
- NULL
-};
+ATTRIBUTE_GROUPS(bxtwc);
static const struct regmap_config bxtwc_regmap_config = {
.reg_bits = 16,