diff options
Diffstat (limited to 'drivers/media/rc/imon.c')
-rw-r--r-- | drivers/media/rc/imon.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index caa3e3ac41cb..6ed96465137a 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
@@ -1658,7 +1658,7 @@ static void usb_rx_callback_intf0(struct urb *urb) | |||
1658 | return; | 1658 | return; |
1659 | 1659 | ||
1660 | ictx = (struct imon_context *)urb->context; | 1660 | ictx = (struct imon_context *)urb->context; |
1661 | if (!ictx) | 1661 | if (!ictx || !ictx->dev_present_intf0) |
1662 | return; | 1662 | return; |
1663 | 1663 | ||
1664 | switch (urb->status) { | 1664 | switch (urb->status) { |
@@ -1690,7 +1690,7 @@ static void usb_rx_callback_intf1(struct urb *urb) | |||
1690 | return; | 1690 | return; |
1691 | 1691 | ||
1692 | ictx = (struct imon_context *)urb->context; | 1692 | ictx = (struct imon_context *)urb->context; |
1693 | if (!ictx) | 1693 | if (!ictx || !ictx->dev_present_intf1) |
1694 | return; | 1694 | return; |
1695 | 1695 | ||
1696 | switch (urb->status) { | 1696 | switch (urb->status) { |
@@ -2118,7 +2118,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
2118 | 2118 | ||
2119 | ictx->dev = dev; | 2119 | ictx->dev = dev; |
2120 | ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf)); | 2120 | ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf)); |
2121 | ictx->dev_present_intf0 = true; | ||
2122 | ictx->rx_urb_intf0 = rx_urb; | 2121 | ictx->rx_urb_intf0 = rx_urb; |
2123 | ictx->tx_urb = tx_urb; | 2122 | ictx->tx_urb = tx_urb; |
2124 | ictx->rf_device = false; | 2123 | ictx->rf_device = false; |
@@ -2157,6 +2156,8 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
2157 | goto rdev_setup_failed; | 2156 | goto rdev_setup_failed; |
2158 | } | 2157 | } |
2159 | 2158 | ||
2159 | ictx->dev_present_intf0 = true; | ||
2160 | |||
2160 | mutex_unlock(&ictx->lock); | 2161 | mutex_unlock(&ictx->lock); |
2161 | return ictx; | 2162 | return ictx; |
2162 | 2163 | ||
@@ -2200,7 +2201,6 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf, | |||
2200 | } | 2201 | } |
2201 | 2202 | ||
2202 | ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf)); | 2203 | ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf)); |
2203 | ictx->dev_present_intf1 = true; | ||
2204 | ictx->rx_urb_intf1 = rx_urb; | 2204 | ictx->rx_urb_intf1 = rx_urb; |
2205 | 2205 | ||
2206 | ret = -ENODEV; | 2206 | ret = -ENODEV; |
@@ -2229,6 +2229,8 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf, | |||
2229 | goto urb_submit_failed; | 2229 | goto urb_submit_failed; |
2230 | } | 2230 | } |
2231 | 2231 | ||
2232 | ictx->dev_present_intf1 = true; | ||
2233 | |||
2232 | mutex_unlock(&ictx->lock); | 2234 | mutex_unlock(&ictx->lock); |
2233 | return ictx; | 2235 | return ictx; |
2234 | 2236 | ||