History

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

usleep_range() is perfect for this.

Sean Young committed 9 years ago

Commit 19bc4e01 parent 43371f61 file · +1 −16Browse files

Showing the changes to drivers/staging/media/lirc (1 of 1 file). Show all

Unified · Split

drivers/staging/media/lirc/lirc_sir.c+1−16
@@ -76,21 +76,6 @@ static inline void soutp(int offset, int value) · 75 unmodified lines
7676 outb(value, io + offset);
7777 }
7878
79−#ifndef MAX_UDELAY_MS
80−#define MAX_UDELAY_US 5000
81−#else
82−#define MAX_UDELAY_US (MAX_UDELAY_MS * 1000)
83−#endif
84−
85−static void safe_udelay(unsigned long usecs)
86−{
87− while (usecs > MAX_UDELAY_US) {
88− udelay(MAX_UDELAY_US);
89− usecs -= MAX_UDELAY_US;
90− }
91− udelay(usecs);
92−}
93−
9479 /* SECTION: Communication with user-space */
9580 static int sir_tx_ir(struct rc_dev *dev, unsigned int *tx_buf,
9681 unsigned int count)
@@ -281,7 +266,7 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id) · 184 unmodified lines
281266
282267 static void send_space(unsigned long len)
283268 {
284− safe_udelay(len);
269+ usleep_range(len, len + 25);
285270 }
286271
287272 static void send_pulse(unsigned long len)