diff options
author | supriya karanth <supriya.karanth@stericsson.com> | 2012-09-14 15:36:23 +0530 |
---|---|---|
committer | Rajanikanth H.V <rajanikanth.hv@stericsson.com> | 2012-12-14 17:07:23 +0530 |
commit | 56cf58df0a2c336f49db0a6159d1bbb2f4a2b9f4 (patch) | |
tree | b902f64c377b98b3ccf388c621a65ee84cef5f8e | |
parent | 189d8bcf68bddebe0b26a1da9629e3473ca1bd48 (diff) |
usb: Fix usb issues during rebootstable-android-ux500-3.4
Added error handling in adb_release.
Fixed warning in ab8500 usb due to the phy_disable call when the
usb phy wasn't enabled.
Signed-off-by: supriya karanth <supriya.karanth@stericsson.com>
-rw-r--r-- | drivers/usb/gadget/f_adb.c | 3 | ||||
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_adb.c b/drivers/usb/gadget/f_adb.c index 1629ffb5b97..4db2a71529a 100644 --- a/drivers/usb/gadget/f_adb.c +++ b/drivers/usb/gadget/f_adb.c @@ -430,6 +430,9 @@ static int adb_release(struct inode *ip, struct file *fp) { pr_info("adb_release\n"); + if (!_adb_dev) + return -ENODEV; + adb_closed_callback(); adb_unlock(&_adb_dev->open_excl); diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index d6e83a4d671..d6b71fcfcfe 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -689,7 +689,7 @@ static int ab8500_usb_set_peripheral(struct usb_otg *otg, * Do not update ab8500 registers directly till this * is fixed. */ - if (!gadget) + if (!gadget && ab->mode == USB_PERIPHERAL) schedule_work(&ab->phy_dis_work); return 0; @@ -710,7 +710,7 @@ static int ab8500_usb_set_host(struct usb_otg *otg, struct usb_bus *host) * Do not update ab8500 registers directly till this * is fixed. */ - if (!host) + if (!host && ab->mode == USB_HOST) schedule_work(&ab->phy_dis_work); return 0; |