From: Andrew Lunn <andrew@lunn.ch>
To: Pawel Dembicki <paweldembicki@gmail.com>
Cc: netdev@vger.kernel.org, Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: phy: vitesse: implement MDI-X configuration in vsc73xx
Date: Thu, 22 Aug 2024 17:58:17 +0200 [thread overview]
Message-ID: <3abe172b-cbad-4879-9dbf-9257e736ec6a@lunn.ch> (raw)
In-Reply-To: <20240822145336.409867-1-paweldembicki@gmail.com>
> +static int vsc73xx_mdix_set(struct phy_device *phydev, u8 mdix)
> +{
> + int ret;
> + u16 val;
> +
> + val = phy_read(phydev, MII_VSC73XX_PHY_BYPASS_CTRL);
> +
> + switch (mdix) {
> + case ETH_TP_MDI:
> + val |= MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |
> + MII_VSC73XX_PBC_PAIR_SWAP_DIS |
> + MII_VSC73XX_PBC_POL_INV_DIS;
> + break;
> + case ETH_TP_MDI_X:
> + /* When MDI-X auto configuration is disabled, is possible
> + * to force only MDI mode. Let's use autoconfig for forced
> + * MDIX mode.
> + */
> + default:
> + val &= ~(MII_VSC73XX_PBC_FOR_SPD_AUTO_MDIX_DIS |
This could be a little bit more readable if rather than default: you
used case ETH_TP_MDI_AUTO: . Then after this code, add a real default:
which returns -EINVAL,
Andrew
---
pw-bot: cr
next prev parent reply other threads:[~2024-08-22 15:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 14:53 Pawel Dembicki
2024-08-22 15:58 ` Andrew Lunn [this message]
2024-08-23 8:46 ` Paweł Dembicki
2024-08-26 2:13 ` Andrew Lunn
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=3abe172b-cbad-4879-9dbf-9257e736ec6a@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paweldembicki@gmail.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
all inboxes | Powered by JetHome®