X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fchar%2Fip2%2Fi2lib.c;h=d6567b32fb5c18c960651fb49fdfee5277225895;hb=c3667d5c321ac2211d04a746f91a48d339a0e0a1;hp=78045767ec33691d7b8b89770c00f5f39b935f48;hpb=f6337e2af42f9ea9ce296cfa18966dcf4f045f7d;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/ip2/i2lib.c b/drivers/char/ip2/i2lib.c index 78045767ec3..d6567b32fb5 100644 --- a/drivers/char/ip2/i2lib.c +++ b/drivers/char/ip2/i2lib.c @@ -150,6 +150,13 @@ i2Validate ( i2ChanStrPtr pCh ) == (CHANNEL_MAGIC | CHANNEL_SUPPORT)); } +static void iiSendPendingMail_t(unsigned long data) +{ + i2eBordStrPtr pB = (i2eBordStrPtr)data; + + iiSendPendingMail(pB); +} + //****************************************************************************** // Function: iiSendPendingMail(pB) // Parameters: Pointer to a board structure @@ -159,7 +166,7 @@ i2Validate ( i2ChanStrPtr pCh ) // If any outgoing mail bits are set and there is outgoing mailbox is empty, // send the mail and clear the bits. //****************************************************************************** -static inline void +static void iiSendPendingMail(i2eBordStrPtr pB) { if (pB->i2eOutMailWaiting && (!pB->i2eWaitingForEmptyFifo) ) @@ -184,12 +191,9 @@ iiSendPendingMail(i2eBordStrPtr pB) /\/\|=mhw=|\/\/ */ if( ++pB->SendPendingRetry < 16 ) { - - init_timer( &(pB->SendPendingTimer) ); - pB->SendPendingTimer.expires = jiffies + 1; - pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail; - pB->SendPendingTimer.data = (unsigned long)pB; - add_timer( &(pB->SendPendingTimer) ); + setup_timer(&pB->SendPendingTimer, + iiSendPendingMail_t, (unsigned long)pB); + mod_timer(&pB->SendPendingTimer, jiffies + 1); } else { printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" ); } @@ -657,7 +661,7 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands, if (!in_interrupt()) { schedule_timeout_interruptible(1); // short nap } else { - // we cannot sched/sleep in interrrupt silly + // we cannot sched/sleep in interrupt silly return 0; } if (signal_pending(current)) { @@ -1265,8 +1269,10 @@ i2RetryFlushOutput(i2ChanStrPtr pCh) // soon as all the data is completely sent. //****************************************************************************** static void -i2DrainWakeup(i2ChanStrPtr pCh) +i2DrainWakeup(unsigned long d) { + i2ChanStrPtr pCh = (i2ChanStrPtr)d; + ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires ); pCh->BookmarkTimer.expires = 0; @@ -1292,14 +1298,12 @@ i2DrainOutput(i2ChanStrPtr pCh, int timeout) } if ((timeout > 0) && (pCh->BookmarkTimer.expires == 0 )) { // One per customer (channel) - init_timer( &(pCh->BookmarkTimer) ); - pCh->BookmarkTimer.expires = jiffies + timeout; - pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup; - pCh->BookmarkTimer.data = (unsigned long)pCh; + setup_timer(&pCh->BookmarkTimer, i2DrainWakeup, + (unsigned long)pCh); ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires ); - add_timer( &(pCh->BookmarkTimer) ); + mod_timer(&pCh->BookmarkTimer, jiffies + timeout); } i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ ); @@ -1373,15 +1377,7 @@ ip2_owake( PTTY tp) ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, (1 << TTY_DO_WRITE_WAKEUP) ); - wake_up_interruptible ( &tp->write_wait ); - if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) ) - && tp->ldisc.write_wakeup ) - { - (tp->ldisc.write_wakeup) ( tp ); - - ip2trace (CHANN, ITRC_SICMD, 11, 0 ); - - } + tty_wakeup(tp); } static inline void