]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: intel_soc_pmic_bxtwc: Switch to use ATTRIBUTE_GROUPS()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 16 Oct 2024 10:49:51 +0000 (13:49 +0300)
committerLee Jones <lee@kernel.org>
Thu, 31 Oct 2024 14:58:50 +0000 (14:58 +0000)
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>
drivers/mfd/intel_soc_pmic_bxtwc.c

index b7204072e93ef882711a0bd53b8873c91a671b3a..c130734f308e51e828d35fcf5902cb6cc24cc5ef 100644 (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,