Do not handroll mdelay(). Suggested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Signed-off-by: Sean Young <sean@xxxxxxxx> --- drivers/media/rc/gpio-ir-tx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/rc/gpio-ir-tx.c b/drivers/media/rc/gpio-ir-tx.c index a50701cfbbd7..d3063ddb472e 100644 --- a/drivers/media/rc/gpio-ir-tx.c +++ b/drivers/media/rc/gpio-ir-tx.c @@ -62,8 +62,13 @@ static void delay_until(ktime_t until) return; /* udelay more than 1ms may not work */ - delta = min(delta, 1000); + if (delta >= 1000) { + mdelay(delta / 1000); + continue; + } + udelay(delta); + break; } } -- 2.35.1