netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Gregory Clement <gregory.clement@bootlin.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 6/7] dsa: mv88e6xxx: Create port/netdev LEDs
Date: Sun, 31 Mar 2024 16:55:44 +0100	[thread overview]
Message-ID: <ZgmHgAhXQpaaKMNb@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240330-v6-8-0-net-next-mv88e6xxx-leds-v4-v2-6-fc5beb9febc5@lunn.ch>

On Sat, Mar 30, 2024 at 01:32:03PM -0500, Andrew Lunn wrote:

> +static int mv88e6xxx_led_brightness_set(struct net_device *ndev,
> +					u8 led, enum led_brightness value)
> +{
> +	struct dsa_switch *ds = dsa_user_to_ds(ndev);
> +	struct mv88e6xxx_chip *chip = ds->priv;
> +	int port = dsa_user_to_index(ndev);

This breaks the model that the DSA layer contains shims to translate
stuff to a dsa_switch pointer and port index. That's not a complaint.
I think it's the right way forward, because the shim later feels like
it makes maintenance needlessly more complex.

I have been thinking whether to do the same for the various phylink
functions - having DSA drivers provide the phylink_mac_ops themselves
where they implement the phylink ops, and convert from the "config"
to dsa_switch+port or whatever is suitable for them where necessary.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2024-03-31 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30 18:31 [PATCH net-next v2 0/7] net: Add generic support for netdev LEDs Andrew Lunn
2024-03-30 18:31 ` [PATCH net-next v2 1/7] dsa: move call to driver port_setup after creation of netdev Andrew Lunn
2024-03-30 18:31 ` [PATCH net-next v2 2/7] net: Add helpers for netdev LEDs Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 3/7] net: dsa: mv88e6xxx: Add helpers for 6352 LED blink and brightness Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 4/7] net: dsa: mv88e6xxx: Tie the low level LED functions to device ops Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 5/7] net: dsa: Add helpers to convert netdev to ds or port index Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 6/7] dsa: mv88e6xxx: Create port/netdev LEDs Andrew Lunn
2024-03-31 15:55   ` Russell King (Oracle) [this message]
2024-04-01 12:43     ` Andrew Lunn
2024-03-30 18:32 ` [PATCH net-next v2 7/7] arm: boot: dts: mvebu: linksys-mamba: Add Ethernet LEDs Andrew Lunn
2024-03-31 16:35   ` Florian Fainelli

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=ZgmHgAhXQpaaKMNb@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregory.clement@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).