summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/bcm5974.c
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-06-08 01:01:48 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-08 01:26:36 -0700
commit1719ec4136035472d3e83a373908dd1b186dbc0b (patch)
treea178a162d10a80bfd8e565e767b10fd2d5301019 /drivers/input/mouse/bcm5974.c
parent4aa5bbeca0fe561181e8fba089cd96e449ee5fca (diff)
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: Luo Jinghua <sunmoon1997@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/bcm5974.c')
-rw-r--r--drivers/input/mouse/bcm5974.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 6dedded27222..354c578ec9d3 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -580,23 +580,30 @@ exit:
*/
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");
- goto error;
+ goto err_out;
}
- if (usb_submit_urb(dev->bt_urb, GFP_KERNEL))
- goto error;
+ error = usb_submit_urb(dev->bt_urb, GFP_KERNEL);
+ 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;
return 0;
err_kill_bt:
usb_kill_urb(dev->bt_urb);
-error:
- return -EIO;
+err_reset_mode:
+ bcm5974_wellspring_mode(dev, false);
+err_out:
+ return error;
}
static void bcm5974_pause_traffic(struct bcm5974 *dev)