diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2025-06-25 13:52:35 +0200 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-26 17:54:06 -0700 |
| commit | 6a0f480478a7ef802ad801eb4690b24442618f50 (patch) | |
| tree | ccba001577903217b50ee00859c2c34617568883 | |
| parent | ptp: Split out PTP_PIN_SETFUNC ioctl code (diff) | |
| download | linux-6a0f480478a7ef802ad801eb4690b24442618f50.tar.gz linux-6a0f480478a7ef802ad801eb4690b24442618f50.zip | |
ptp: Split out PTP_MASK_CLEAR_ALL ioctl code
Continue the ptp_ioctl() cleanup by splitting out the PTP_MASK_CLEAR_ALL ioctl
code into a helper function.
No functional change intended.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20250625115133.302755618@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/ptp/ptp_chardev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c index 176bdfdcc35b..3fbbbc09a7ba 100644 --- a/drivers/ptp/ptp_chardev.c +++ b/drivers/ptp/ptp_chardev.c @@ -435,6 +435,12 @@ static long ptp_pin_setfunc(struct ptp_clock *ptp, unsigned int cmd, void __user return ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan); } +static long ptp_mask_clear_all(struct timestamp_event_queue *tsevq) +{ + bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS); + return 0; +} + long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd, unsigned long arg) { @@ -497,8 +503,7 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd, return ptp_pin_setfunc(ptp, cmd, argptr); case PTP_MASK_CLEAR_ALL: - bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS); - break; + return ptp_mask_clear_all(pccontext->private_clkdata); case PTP_MASK_EN_SINGLE: if (copy_from_user(&i, (void __user *)arg, sizeof(i))) { |
