public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 6/8] net: mdio: use macro __ATTRIBUTE_GROUPS
Date: Fri, 27 Feb 2026 23:09:35 +0100	[thread overview]
Message-ID: <260fb184-c662-415c-b288-e1423097f2b9@gmail.com> (raw)
In-Reply-To: <799114be-1456-442b-b479-142e7ee9d254@gmail.com>

Use macro __ATTRIBUTE_GROUPS() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/mdio_bus.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 750b9165086..0e2820ab8cb 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -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,
 };
-- 
2.53.0



  parent reply	other threads:[~2026-02-27 22:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27 22:04 [PATCH net-next 0/8] net: phy: improve stats handling in mdio_bus.c Heiner Kallweit
2026-02-27 22:05 ` [PATCH net-next 1/8] net: mdio: extend struct mdio_bus_stat_attr instead of using dev_ext_attribute Heiner Kallweit
2026-02-27 22:06 ` [PATCH net-next 2/8] net: mdio: use macro __ATTR to simplify the code Heiner Kallweit
2026-02-27 22:07 ` [PATCH net-next 3/8] net: phy: consider that mdio_bus_device_stat_field_show doesn't use member address Heiner Kallweit
2026-02-27 22:07 ` [PATCH net-next 4/8] net: phy: avoid extra casting in mdio_bus_get_stat Heiner Kallweit
2026-02-27 22:08 ` [PATCH net-next 5/8] net: mdio: constify attributes and attribute arrays Heiner Kallweit
2026-02-27 22:09 ` Heiner Kallweit [this message]
2026-02-27 22:10 ` [PATCH net-next 7/8] net: phy: inline helper mdio_bus_get_global_stat Heiner Kallweit
2026-02-27 22:11 ` [PATCH net-next 8/8] net: phy: improve mdiobus_stats_acct Heiner Kallweit
2026-03-05  8:31   ` Marek Szyprowski
2026-03-05  9:57     ` Heiner Kallweit
2026-03-03 12:30 ` [PATCH net-next 0/8] net: phy: improve stats handling in mdio_bus.c patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=260fb184-c662-415c-b288-e1423097f2b9@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox