diff options
author | Sean Young <sean@mess.org> | 2022-04-07 11:43:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-05-08 08:07:16 +0300 |
commit | 2a952d92f75b1f71a3a00f05536c6b7eff700b0f (patch) | |
tree | 9aebc85467f728ce2cf139fff326adbced637ea4 /drivers/media/rc | |
parent | 6c1c1eb8c87de221051b9198d40971640060842f (diff) | |
download | linux-2a952d92f75b1f71a3a00f05536c6b7eff700b0f.tar.xz |
media: gpio-ir-tx: simplify wait logic
Do not handroll mdelay().
Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/gpio-ir-tx.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } } |