Commit 9bbf84e6 authored by Anton Bondarenko's avatar Anton Bondarenko Committed by Greg Kroah-Hartman

staging: octeon-usb: use correct function for hcd cleanup

Use usb_put_hdc to release hdc allocated by usb_create_hcd.
This is needed to handle sub-allocations and HCD sharing correctly.
Signed-off-by: default avatarAnton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 92abe42b
...@@ -3659,14 +3659,14 @@ static int octeon_usb_probe(struct platform_device *pdev) ...@@ -3659,14 +3659,14 @@ static int octeon_usb_probe(struct platform_device *pdev)
status = cvmx_usb_initialize(dev, usb); status = cvmx_usb_initialize(dev, usb);
if (status) { if (status) {
dev_dbg(dev, "USB initialization failed with %d\n", status); dev_dbg(dev, "USB initialization failed with %d\n", status);
kfree(hcd); usb_put_hcd(hcd);
return -1; return -1;
} }
status = usb_add_hcd(hcd, irq, 0); status = usb_add_hcd(hcd, irq, 0);
if (status) { if (status) {
dev_dbg(dev, "USB add HCD failed with %d\n", status); dev_dbg(dev, "USB add HCD failed with %d\n", status);
kfree(hcd); usb_put_hcd(hcd);
return -1; return -1;
} }
device_wakeup_enable(hcd->self.controller); device_wakeup_enable(hcd->self.controller);
...@@ -3691,7 +3691,7 @@ static int octeon_usb_remove(struct platform_device *pdev) ...@@ -3691,7 +3691,7 @@ static int octeon_usb_remove(struct platform_device *pdev)
if (status) if (status)
dev_dbg(dev, "USB shutdown failed with %d\n", status); dev_dbg(dev, "USB shutdown failed with %d\n", status);
kfree(hcd); usb_put_hcd(hcd);
return 0; return 0;
} }
......
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