提交 19bc4e05 编写于 作者: S Sean Young 提交者: Mauro Carvalho Chehab

[media] staging: sir: use usleep_range() rather than busy looping

usleep_range() is perfect for this.
Signed-off-by: NSean Young <sean@mess.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 43371f6b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册