diff options
author | Sean Young <sean@mess.org> | 2017-03-07 17:01:48 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-05 14:49:02 -0300 |
commit | 19bc4e05fa9600a62051de637d0b1fda5585da64 (patch) | |
tree | 9607df57cbe4b2cf7433b2de4f0586eac51d6fa0 | |
parent | 43371f6b327f9fbf1df057be7ce057a0fd841e4c (diff) |
[media] staging: sir: use usleep_range() rather than busy looping
usleep_range() is perfect for this.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/staging/media/lirc/lirc_sir.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c index 1362900f2ec4..e21f163026d8 100644 --- a/drivers/staging/media/lirc/lirc_sir.c +++ b/drivers/staging/media/lirc/lirc_sir.c @@ -76,21 +76,6 @@ static inline void soutp(int offset, int value) outb(value, io + offset); } -#ifndef MAX_UDELAY_MS -#define MAX_UDELAY_US 5000 -#else -#define MAX_UDELAY_US (MAX_UDELAY_MS * 1000) -#endif - -static void safe_udelay(unsigned long usecs) -{ - while (usecs > MAX_UDELAY_US) { - udelay(MAX_UDELAY_US); - usecs -= MAX_UDELAY_US; - } - udelay(usecs); -} - /* SECTION: Communication with user-space */ static int sir_tx_ir(struct rc_dev *dev, unsigned int *tx_buf, unsigned int count) @@ -281,7 +266,7 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id) static void send_space(unsigned long len) { - safe_udelay(len); + usleep_range(len, len + 25); } static void send_pulse(unsigned long len) |