On Wed, 12 May 2004, Oliver Neukum wrote:
> diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
> --- a/drivers/usb/core/usb.c Wed May 12 22:46:51 2004
> +++ b/drivers/usb/core/usb.c Wed May 12 22:46:51 2004
> @@ -40,6 +40,7 @@
> #include <linux/errno.h>
> #include <linux/smp_lock.h>
> #include <linux/usb.h>
> +#include <linux/time.h>
Is that #include really needed? linux/sched.h (needed for
schedule_timeout()) already #includes the definition of HZ.
>
> #include <asm/io.h>
> #include <asm/scatterlist.h>
> @@ -1543,6 +1544,21 @@
> return 0;
> }
>
> +/**
> + * usb_uninterruptible_sleep_ms - safely free an amount of time uninterruptably
> + * @msecs: how long to sleep, given in milliseconds
> + */
> +
> +void usb_uninterruptible_sleep_ms (int msecs)
> +{
> + long timeout = MSEC_TO_JIFFIES(msecs);
I don't see MSEC_TO_JIFFIES defined anywhere. What am I missing?
> +
> + while (timeout) {
> + set_current_state(TASK_UNINTERRUPTIBLE);
> + timeout = schedule_timeout(timeout);
> + }
> +}
> +
> struct bus_type usb_bus_type = {
> .name = "usb",
> .match = usb_device_match,
> @@ -1646,6 +1662,8 @@
>
> EXPORT_SYMBOL (usb_buffer_alloc);
> EXPORT_SYMBOL (usb_buffer_free);
> +
> +EXPORT_SYMBOL (usb_uninterruptible_sleep_ms);
>
> EXPORT_SYMBOL (usb_buffer_map);
> #if 0
>
How about adding a declaration to linux/usb.h as well?
And are interruptible sleeps common enough to warrant their own routine
along with this one?
Alan Stern
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel