@@ -606,9 +606,9 @@ static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *file_data,
606
606
{
607
607
struct usbtmc_device_data * data = file_data -> data ;
608
608
struct device * dev = & data -> intf -> dev ;
609
- int rv ;
610
609
u32 timeout ;
611
610
unsigned long expire ;
611
+ long wait_rv ;
612
612
613
613
if (!data -> iin_ep_present ) {
614
614
dev_dbg (dev , "no interrupt endpoint present\n" );
@@ -622,25 +622,24 @@ static int usbtmc488_ioctl_wait_srq(struct usbtmc_file_data *file_data,
622
622
623
623
mutex_unlock (& data -> io_mutex );
624
624
625
- rv = wait_event_interruptible_timeout (
626
- data -> waitq ,
627
- atomic_read (& file_data -> srq_asserted ) != 0 ||
628
- atomic_read (& file_data -> closing ),
629
- expire );
625
+ wait_rv = wait_event_interruptible_timeout (
626
+ data -> waitq ,
627
+ atomic_read (& file_data -> srq_asserted ) != 0 ||
628
+ atomic_read (& file_data -> closing ),
629
+ expire );
630
630
631
631
mutex_lock (& data -> io_mutex );
632
632
633
633
/* Note! disconnect or close could be called in the meantime */
634
634
if (atomic_read (& file_data -> closing ) || data -> zombie )
635
- rv = - ENODEV ;
635
+ return - ENODEV ;
636
636
637
- if (rv < 0 ) {
638
- /* dev can be invalid now! */
639
- pr_debug ("%s - wait interrupted %d\n" , __func__ , rv );
640
- return rv ;
637
+ if (wait_rv < 0 ) {
638
+ dev_dbg (dev , "%s - wait interrupted %ld\n" , __func__ , wait_rv );
639
+ return wait_rv ;
641
640
}
642
641
643
- if (rv == 0 ) {
642
+ if (wait_rv == 0 ) {
644
643
dev_dbg (dev , "%s - wait timed out\n" , __func__ );
645
644
return - ETIMEDOUT ;
646
645
}
0 commit comments