[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1uyAP2-00000005lGk-2q9l@rmk-PC.armlinux.org.uk>
Date: Mon, 15 Sep 2025 15:42:00 +0100
From: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
To: Richard Cochran <richardcochran@...il.com>
Cc: Ajay Kaher <ajay.kaher@...adcom.com>,
Alexey Makhalov <alexey.makhalov@...adcom.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Clark Wang <xiaoning.wang@....com>,
"David S. Miller" <davem@...emloft.net>,
David Woodhouse <dwmw2@...radead.org>,
Eric Dumazet <edumazet@...gle.com>,
imx@...ts.linux.dev,
Jakub Kicinski <kuba@...nel.org>,
Jonathan Lemon <jonathan.lemon@...il.com>,
netdev@...r.kernel.org,
Nick Shi <nick.shi@...adcom.com>,
Paolo Abeni <pabeni@...hat.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Vladimir Oltean <vladimir.oltean@....com>,
Wei Fang <wei.fang@....com>,
Yangbo Lu <yangbo.lu@....com>
Subject: [PATCH net-next 1/2] ptp: describe the two disables in
ptp_set_pinfunc()
Accurately describe what each call to ptp_disable_pinfunc() is doing,
rather than the misleading comment above the first disable. This helps
to make the code more readable.
Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
---
drivers/ptp/ptp_chardev.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index e9719f365aab..eb4f6d1b1460 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -91,12 +91,18 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin,
return -EOPNOTSUPP;
}
- /* Disable whatever function was previously assigned. */
+ /* Disable whichever pin was previously assigned to this function and
+ * channel.
+ */
if (pin1) {
ptp_disable_pinfunc(info, func, chan);
pin1->func = PTP_PF_NONE;
pin1->chan = 0;
}
+
+ /* Disable whatever function was previously assigned to the requested
+ * pin.
+ */
ptp_disable_pinfunc(info, pin2->func, pin2->chan);
pin2->func = func;
pin2->chan = chan;
--
2.47.3
Powered by blists - more mailing lists