[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <08dd3467-7720-46e1-8c72-1d46d951f90d@lunn.ch>
Date: Sun, 3 Sep 2023 19:22:17 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Lukasz Majewski <lukma@...x.de>
Cc: Eric Dumazet <edumazet@...gle.com>, davem@...emloft.net,
Paolo Abeni <pabeni@...hat.com>,
Woojung Huh <woojung.huh@...rochip.com>,
Vladimir Oltean <olteanv@...il.com>, Tristram.Ha@...rochip.com,
Florian Fainelli <f.fainelli@...il.com>,
Jakub Kicinski <kuba@...nel.org>, UNGLinuxDriver@...rochip.com,
George McCollister <george.mccollister@...il.com>,
Oleksij Rempel <o.rempel@...gutronix.de>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] net: dsa: hsr: Provide generic HSR
ksz_hsr_{join|leave} functions
> +static int ksz_hsr_join(struct dsa_switch *ds, int port, struct net_device *hsr)
> +{
> + struct dsa_port *partner = NULL, *dp;
> + struct ksz_device *dev = ds->priv;
> + enum hsr_version ver;
> + int ret;
> +
> + ret = hsr_get_version(hsr, &ver);
> + if (ret)
> + return ret;
> +
> + switch (dev->chip_id) {
> + case KSZ9477_CHIP_ID:
> + if (ver == PRP_V1)
> + return -EOPNOTSUPP;
This should probably check for versions which are support, and not
assume PRP_V42 is not added some time in the future, which would be
accepted here.
Andrew
Powered by blists - more mailing lists