summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAxel Lin2011-04-21 16:22:41 +0200
committerFelipe Balbi2011-05-02 11:34:34 +0200
commitd11536e4e0e99c26d33c849b44cd279cdd67b032 (patch)
tree8319291780b24636dd21c8cb06746ffc220adf84 /drivers/mfd
parentusb: musb: gadget: Fix out-of-sync runtime pm calls (diff)
downloadkernel-qcow2-linux-d11536e4e0e99c26d33c849b44cd279cdd67b032.tar.gz
kernel-qcow2-linux-d11536e4e0e99c26d33c849b44cd279cdd67b032.tar.xz
kernel-qcow2-linux-d11536e4e0e99c26d33c849b44cd279cdd67b032.zip
mfd: Fix usbhs_enable error handling
In the case of missing platform_data we do not hold a spin_lock, thus we should not call spin_unlock_irqrestore in the error path. Also simplify the error handling by separating the successful path from error path. I think this change improves readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Tested-by: Steve Calfee <stevecalfee@gmail.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/omap-usb-host.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 53450f433f10..b3bb3ac5b045 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -700,8 +700,7 @@ static int usbhs_enable(struct device *dev)
dev_dbg(dev, "starting TI HSUSB Controller\n");
if (!pdata) {
dev_dbg(dev, "missing platform_data\n");
- ret = -ENODEV;
- goto end_enable;
+ return -ENODEV;
}
spin_lock_irqsave(&omap->lock, flags);
@@ -915,7 +914,8 @@ static int usbhs_enable(struct device *dev)
end_count:
omap->count++;
- goto end_enable;
+ spin_unlock_irqrestore(&omap->lock, flags);
+ return 0;
err_tll:
if (pdata->ehci_data->phy_reset) {
@@ -931,8 +931,6 @@ err_tll:
clk_disable(omap->usbhost_fs_fck);
clk_disable(omap->usbhost_hs_fck);
clk_disable(omap->usbhost_ick);
-
-end_enable:
spin_unlock_irqrestore(&omap->lock, flags);
return ret;
}