Bryan Mayland wrote:
Morten Rønseth wrote:

What is the easy fix? Could one just use 'msleep'? Could "someone" write a wrapper for 'msleep_interruptible' (I could if I had the exact spec...)?

   This might work, although I'm sure there's a much more elequent solution.  This just defines a msleep_interuptible for kernel version 2.6.7 or below.


Index: tda9887.c =================================================================== --- tda9887.c (revision 263) +++ tda9887.c (working copy) @@ -545,6 +545,19 @@ return 0; } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 7) +static unsigned int msleep_interruptible(unsigned int msecs) +{ + unsigned long timeout = msecs_to_jiffies(msecs); + + while (timeout && !signal_pending(current)) { + set_current_state(TASK_INTERRUPTIBLE); + timeout = schedule_timeout(timeout); + } + return jiffies_to_msecs(timeout); +} +#endif + static int tda9887_configure(struct tda9887 *t) { unsigned char buf[4];
Looks good - but what are jiffies....? I remember the ads from times long past, about "jiffies", in the UK - cannot possibly be a connection here...! :-) (I'll say no more)
Seriously, this could be good. At least the infamous jiffies are defined in "/usr/include/linux/time.h" on my system (Mandrake 10.1).


Cheers,


-Morten


Reply via email to