Use wait_event_interruptible_timeout() instead of the deprecated interruptible_sleep_on_timeout(). Patch is compile-tested. Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx> Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx> --- kj-domen/drivers/net/tokenring/lanstreamer.c | 44 +++++++++++---------------- 1 files changed, 19 insertions(+), 25 deletions(-) diff -puN drivers/net/tokenring/lanstreamer.c~int_sleep_on-drivers_net_tokenring_lanstreamer drivers/net/tokenring/lanstreamer.c --- kj/drivers/net/tokenring/lanstreamer.c~int_sleep_on-drivers_net_tokenring_lanstreamer 2005-03-05 16:11:41.000000000 +0100 +++ kj-domen/drivers/net/tokenring/lanstreamer.c 2005-03-05 16:11:41.000000000 +0100 @@ -121,6 +121,7 @@ #include <linux/spinlock.h> #include <linux/version.h> #include <linux/bitops.h> +#include <linux/wait.h> #include <net/checksum.h> @@ -669,17 +670,15 @@ static int streamer_open(struct net_devi writew(LISR_SRB_CMD, streamer_mmio + LISR_SUM); spin_unlock_irqrestore(&streamer_priv->streamer_lock, flags); - while (streamer_priv->srb_queued) { - interruptible_sleep_on_timeout(&streamer_priv->srb_wait, 5 * HZ); - if (signal_pending(current)) { - printk(KERN_WARNING "%s: SRB timed out.\n", dev->name); - printk(KERN_WARNING "SISR=%x MISR=%x, LISR=%x\n", - readw(streamer_mmio + SISR), - readw(streamer_mmio + MISR_RUM), - readw(streamer_mmio + LISR)); - streamer_priv->srb_queued = 0; - break; - } + wait_event_interruptible_timeout(streamer_priv->srb_wait, + !streamer_priv->srb_queued, 5 * HZ); + if (signal_pending(current)) { + printk(KERN_WARNING "%s: SRB timed out.\n", dev->name); + printk(KERN_WARNING "SISR=%x MISR=%x, LISR=%x\n", + readw(streamer_mmio + SISR), + readw(streamer_mmio + MISR_RUM), + readw(streamer_mmio + LISR)); + streamer_priv->srb_queued = 0; } #if STREAMER_DEBUG @@ -1223,20 +1222,15 @@ static int streamer_close(struct net_dev spin_unlock_irqrestore(&streamer_priv->streamer_lock, flags); - while (streamer_priv->srb_queued) - { - interruptible_sleep_on_timeout(&streamer_priv->srb_wait, - jiffies + 60 * HZ); - if (signal_pending(current)) - { - printk(KERN_WARNING "%s: SRB timed out.\n", dev->name); - printk(KERN_WARNING "SISR=%x MISR=%x LISR=%x\n", - readw(streamer_mmio + SISR), - readw(streamer_mmio + MISR_RUM), - readw(streamer_mmio + LISR)); - streamer_priv->srb_queued = 0; - break; - } + wait_event_interruptible_timeout(streamer_priv->srb_wait, + !streamer_priv->srb_queued, 60*HZ); + if (signal_pending(current)) { + printk(KERN_WARNING "%s: SRB timed out.\n", dev->name); + printk(KERN_WARNING "SISR=%x MISR=%x LISR=%x\n", + readw(streamer_mmio + SISR), + readw(streamer_mmio + MISR_RUM), + readw(streamer_mmio + LISR)); + streamer_priv->srb_queued = 0; } streamer_priv->rx_ring_last_received = (streamer_priv->rx_ring_last_received + 1) & (STREAMER_RX_RING_SIZE - 1); _ - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html