Commit 1719ec41 authored by Luo Jinghua's avatar Luo Jinghua Committed by Dmitry Torokhov

Input: bcm5974 - turn wellspring mode off if failed to start traffic

If we fail to submit URBs we should take touchpad out of wellsping
mode.
Signed-off-by: default avatarLuo Jinghua <sunmoon1997@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 4aa5bbec
...@@ -580,23 +580,30 @@ static void bcm5974_irq_trackpad(struct urb *urb) ...@@ -580,23 +580,30 @@ static void bcm5974_irq_trackpad(struct urb *urb)
*/ */
static int bcm5974_start_traffic(struct bcm5974 *dev) static int bcm5974_start_traffic(struct bcm5974 *dev)
{ {
if (bcm5974_wellspring_mode(dev, true)) { int error;
error = bcm5974_wellspring_mode(dev, true);
if (error) {
dprintk(1, "bcm5974: mode switch failed\n"); dprintk(1, "bcm5974: mode switch failed\n");
goto error; goto err_out;
} }
if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) error = usb_submit_urb(dev->bt_urb, GFP_KERNEL);
goto error; if (error)
goto err_reset_mode;
if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) error = usb_submit_urb(dev->tp_urb, GFP_KERNEL);
if (error)
goto err_kill_bt; goto err_kill_bt;
return 0; return 0;
err_kill_bt: err_kill_bt:
usb_kill_urb(dev->bt_urb); usb_kill_urb(dev->bt_urb);
error: err_reset_mode:
return -EIO; bcm5974_wellspring_mode(dev, false);
err_out:
return error;
} }
static void bcm5974_pause_traffic(struct bcm5974 *dev) static void bcm5974_pause_traffic(struct bcm5974 *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment