]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: mdio: use macro __ATTRIBUTE_GROUPS
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 27 Feb 2026 22:09:35 +0000 (23:09 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 3 Mar 2026 12:23:45 +0000 (13:23 +0100)
Use macro __ATTRIBUTE_GROUPS() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/260fb184-c662-415c-b288-e1423097f2b9@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/phy/mdio_bus.c

index 750b9165086f9142c8b23168803bb8041d3c47a8..0e2820ab8cbef34d20a1f37264840391d7f31d0c 100644 (file)
@@ -310,16 +310,12 @@ static const struct attribute_group mdio_bus_statistics_group = {
        .name           = "statistics",
        .attrs_const    = mdio_bus_statistics_attrs,
 };
-
-static const struct attribute_group *mdio_bus_groups[] = {
-       &mdio_bus_statistics_group,
-       NULL,
-};
+__ATTRIBUTE_GROUPS(mdio_bus_statistics);
 
 const struct class mdio_bus_class = {
        .name           = "mdio_bus",
        .dev_release    = mdiobus_release,
-       .dev_groups     = mdio_bus_groups,
+       .dev_groups     = mdio_bus_statistics_groups,
 };
 EXPORT_SYMBOL_GPL(mdio_bus_class);
 
@@ -986,15 +982,11 @@ static const struct attribute_group mdio_bus_device_statistics_group = {
        .name           = "statistics",
        .attrs_const    = mdio_bus_device_statistics_attrs,
 };
-
-static const struct attribute_group *mdio_bus_dev_groups[] = {
-       &mdio_bus_device_statistics_group,
-       NULL,
-};
+__ATTRIBUTE_GROUPS(mdio_bus_device_statistics);
 
 const struct bus_type mdio_bus_type = {
        .name           = "mdio_bus",
-       .dev_groups     = mdio_bus_dev_groups,
+       .dev_groups     = mdio_bus_device_statistics_groups,
        .match          = mdio_bus_match,
        .uevent         = mdio_uevent,
 };