]> www.infradead.org Git - users/hch/misc.git/commitdiff
ptp: describe the two disables in ptp_set_pinfunc()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 16 Sep 2025 21:35:58 +0000 (22:35 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Sep 2025 22:04:09 +0000 (15:04 -0700)
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.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Link: https://patch.msgid.link/E1uydLC-000000061DG-2BRt@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_chardev.c

index e9719f365aabd86fed3ee52e9a377ea250262feb..eb4f6d1b14604e01135136021f790d067757b7ee 100644 (file)
@@ -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;