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>
This commit is contained in:
Andy Shevchenko 2024-10-16 13:49:51 +03:00 committed by Lee Jones
parent f2be0c3a95
commit 1f9e418aaf

View File

@ -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,