Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Ajay Kaher <ajay.kaher@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	David Woodhouse <dwmw2@infradead.org>,
	Eric Dumazet <edumazet@google.com>,
	imx@lists.linux.dev, Jakub Kicinski <kuba@kernel.org>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	netdev@vger.kernel.org, Nick Shi <nick.shi@broadcom.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Wei Fang <wei.fang@nxp.com>, Yangbo Lu <yangbo.lu@nxp.com>
Subject: [PATCH net-next 1/2] ptp: describe the two disables in ptp_set_pinfunc()
Date: Mon, 15 Sep 2025 15:42:00 +0100	[thread overview]
Message-ID: <E1uyAP2-00000005lGk-2q9l@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aMglp11mUGk9PAvu@shell.armlinux.org.uk>

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@armlinux.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


  reply	other threads:[~2025-09-15 14:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 14:41 [PATCH net-next 0/2] ptp: safely cleanup when unregistering a PTP clock Russell King (Oracle)
2025-09-15 14:42 ` Russell King (Oracle) [this message]
2025-09-16 10:37   ` [PATCH net-next 1/2] ptp: describe the two disables in ptp_set_pinfunc() Vladimir Oltean
2025-09-16 12:44   ` Vadim Fedorenko
2025-09-15 14:42 ` [PATCH net-next 2/2] ptp: rework ptp_clock_unregister() to disable events Russell King (Oracle)
2025-09-16  9:03   ` Wei Fang
2025-09-16 13:38     ` Russell King (Oracle)
2025-09-16 14:38       ` Andrew Lunn
2025-09-16 13:02   ` Vadim Fedorenko
2025-09-16 15:45     ` Russell King (Oracle)
2025-09-16 16:20       ` Vadim Fedorenko
2025-09-16 19:46         ` Russell King (Oracle)
2025-09-16 21:22           ` Russell King (Oracle)
2025-09-16  8:37 ` [PATCH net-next 0/2] ptp: safely cleanup when unregistering a PTP clock Wei Fang

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=E1uyAP2-00000005lGk-2q9l@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=ajay.kaher@broadcom.com \
    --cc=alexey.makhalov@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nick.shi@broadcom.com \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=svens@linux.ibm.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    --cc=yangbo.lu@nxp.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