[PATCH] staging: dgap: use schedule_timeout_interruptible() instead of dgap_ms_sleep()

Dan Carpenter dan.carpenter at oracle.com
Tue Sep 16 06:31:15 UTC 2014


On Tue, Sep 16, 2014 at 12:33:33PM +0900, Daeseok Youn wrote:
> @@ -2297,12 +2273,12 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file)
>  			 * Go to sleep to ensure RTS/DTR
>  			 * have been dropped for modems to see it.
>  			 */
> -			if (ch->ch_close_delay) {
> -				spin_unlock_irqrestore(&ch->ch_lock,
> -						       lock_flags);
> -				dgap_ms_sleep(ch->ch_close_delay);
> -				spin_lock_irqsave(&ch->ch_lock, lock_flags);
> -			}
> +			spin_unlock_irqrestore(&ch->ch_lock,
> +					lock_flags);
> +			/* .25 second delay for dropping RTS/DTR */
> +			schedule_timeout_interruptible(msecs_to_jiffies(250));
> +			signal_pending(current);

There is no point in calling signal_pending() if you don't care about
the return value.

> +			spin_lock_irqsave(&ch->ch_lock, lock_flags);
>  		}
>  

regards,
dan carpenter


More information about the devel mailing list