diff options
author | Matthias Blankertz <matthias.blankertz@cetitec.com> | 2018-05-22 15:24:48 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-05-30 11:59:10 +0200 |
commit | 3f484226793166c75bd56784832d4c1a84061ad5 (patch) | |
tree | 5455c30789e09f4dc38f65d87237971483d8c8d2 /drivers/usb/host/xhci-rcar.c | |
parent | c3c863880479edeb5b08226e622d13c91326e4a7 (diff) |
usb: xhci-rcar: deregister before deactivating clock
During the execution of xhci_deregister xHCI registers are accessed. If
the clock is already deactivated when xhci_deregister is called this can
lead to undefined behavior. Change the order to deregister the device
before deactivating the clock.
Signed-off-by: Matthias Blankertz <matthias.blankertz@cetitec.com>
Diffstat (limited to 'drivers/usb/host/xhci-rcar.c')
-rw-r--r-- | drivers/usb/host/xhci-rcar.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c index a837afc483..f2e91ef0fe 100644 --- a/drivers/usb/host/xhci-rcar.c +++ b/drivers/usb/host/xhci-rcar.c @@ -117,12 +117,15 @@ err_clk: static int xhci_rcar_deregister(struct udevice *dev) { + int ret; struct rcar_xhci_platdata *plat = dev_get_platdata(dev); + ret = xhci_deregister(dev); + clk_disable(&plat->clk); clk_free(&plat->clk); - return xhci_deregister(dev); + return ret; } static int xhci_rcar_ofdata_to_platdata(struct udevice *dev) |