[tip: timers/core] media: pwm-ir-tx: Avoid direct access to hrtimer clockbase

tip-bot2 for Thomas Weißschuh posted 1 patch 3 weeks, 2 days ago
There is a newer version of this series
drivers/media/rc/pwm-ir-tx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[tip: timers/core] media: pwm-ir-tx: Avoid direct access to hrtimer clockbase
Posted by tip-bot2 for Thomas Weißschuh 3 weeks, 2 days ago
The following commit has been merged into the timers/core branch of tip:

Commit-ID:     12bbd35144939dbe9324b55fb1f50a0be2f0d6de
Gitweb:        https://git.kernel.org/tip/12bbd35144939dbe9324b55fb1f50a0be2f0d6de
Author:        Thomas Weißschuh <thomas.weissschuh@linutronix.de>
AuthorDate:    Tue, 12 Aug 2025 08:08:14 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 09 Sep 2025 10:53:19 +02:00

media: pwm-ir-tx: Avoid direct access to hrtimer clockbase

The field timer->base->get_time is a private implementation detail and
should not be accessed outside of the hrtimer core.

Switch to an equivalent higher-level helper.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Sean Young <sean@mess.org>
Link: https://lore.kernel.org/all/20250812-hrtimer-cleanup-get_time-v1-6-b962cd9d9385@linutronix.de

---
 drivers/media/rc/pwm-ir-tx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/media/rc/pwm-ir-tx.c b/drivers/media/rc/pwm-ir-tx.c
index 84533fd..047472d 100644
--- a/drivers/media/rc/pwm-ir-tx.c
+++ b/drivers/media/rc/pwm-ir-tx.c
@@ -117,7 +117,6 @@ static int pwm_ir_tx_atomic(struct rc_dev *dev, unsigned int *txbuf,
 static enum hrtimer_restart pwm_ir_timer(struct hrtimer *timer)
 {
 	struct pwm_ir *pwm_ir = container_of(timer, struct pwm_ir, timer);
-	ktime_t now;
 
 	/*
 	 * If we happen to hit an odd latency spike, loop through the
@@ -139,9 +138,7 @@ static enum hrtimer_restart pwm_ir_timer(struct hrtimer *timer)
 		hrtimer_add_expires_ns(timer, ns);
 
 		pwm_ir->txbuf_index++;
-
-		now = timer->base->get_time();
-	} while (hrtimer_get_expires_tv64(timer) < now);
+	} while (hrtimer_expires_remaining(timer) > 0);
 
 	return HRTIMER_RESTART;
 }