[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1uzIbZ-00000006mzu-3pQK@rmk-PC.armlinux.org.uk>
Date: Thu, 18 Sep 2025 18:39:37 +0100
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH RFC net-next 09/20] net: dsa: mv88e6xxx: always verify
PTP_PF_NONE
Setting a pin to "no function" should always be supported. Move this
to mv88e6xxx_ptp_verify(). This allows mv88e6352_ptp_verify() to be
simplified as the only supported PTP pin mode function is
PTP_PF_EXTTS.
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
drivers/net/dsa/mv88e6xxx/ptp.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c
index 03f30424ba97..72ad6be05943 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.c
+++ b/drivers/net/dsa/mv88e6xxx/ptp.c
@@ -319,6 +319,10 @@ static int mv88e6xxx_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
{
struct mv88e6xxx_chip *chip = ptp_to_chip(ptp);
+ /* Always allow a pin to be set to no function */
+ if (func == PTP_PF_NONE)
+ return 0;
+
return chip->info->ops->ptp_ops->ptp_verify(chip, pin, func, chan);
}
@@ -382,14 +386,9 @@ static int mv88e6352_ptp_enable(struct mv88e6xxx_chip *chip,
static int mv88e6352_ptp_verify(struct mv88e6xxx_chip *chip, unsigned int pin,
enum ptp_pin_function func, unsigned int chan)
{
- switch (func) {
- case PTP_PF_NONE:
- case PTP_PF_EXTTS:
- break;
- case PTP_PF_PEROUT:
- case PTP_PF_PHYSYNC:
+ if (func != PTP_PF_EXTTS)
return -EOPNOTSUPP;
- }
+
return 0;
}
--
2.47.3
Powered by blists - more mailing lists