mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'
[ Upstream commite5242861ec] Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error handling path of the probe function, as already done in the remove function. Fixes:3fc154b6b8("USB Gadget driver for Samsung s3c2410 ARM SoC") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/2bee52e4ce968f48b4c32545cf8f3b2ab825ba82.1616830026.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0764c91011
commit
42c9f39a72
|
|
@ -1750,7 +1750,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
|
||||||
udc_clock = clk_get(NULL, "usb-device");
|
udc_clock = clk_get(NULL, "usb-device");
|
||||||
if (IS_ERR(udc_clock)) {
|
if (IS_ERR(udc_clock)) {
|
||||||
dev_err(dev, "failed to get udc clock source\n");
|
dev_err(dev, "failed to get udc clock source\n");
|
||||||
return PTR_ERR(udc_clock);
|
retval = PTR_ERR(udc_clock);
|
||||||
|
goto err_usb_bus_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
clk_prepare_enable(udc_clock);
|
clk_prepare_enable(udc_clock);
|
||||||
|
|
@ -1773,7 +1774,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
|
||||||
base_addr = devm_platform_ioremap_resource(pdev, 0);
|
base_addr = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(base_addr)) {
|
if (IS_ERR(base_addr)) {
|
||||||
retval = PTR_ERR(base_addr);
|
retval = PTR_ERR(base_addr);
|
||||||
goto err;
|
goto err_udc_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
the_controller = udc;
|
the_controller = udc;
|
||||||
|
|
@ -1791,7 +1792,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
dev_err(dev, "cannot get irq %i, err %d\n", irq_usbd, retval);
|
dev_err(dev, "cannot get irq %i, err %d\n", irq_usbd, retval);
|
||||||
retval = -EBUSY;
|
retval = -EBUSY;
|
||||||
goto err;
|
goto err_udc_clk;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev_dbg(dev, "got irq %i\n", irq_usbd);
|
dev_dbg(dev, "got irq %i\n", irq_usbd);
|
||||||
|
|
@ -1862,7 +1863,14 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
|
||||||
gpio_free(udc_info->vbus_pin);
|
gpio_free(udc_info->vbus_pin);
|
||||||
err_int:
|
err_int:
|
||||||
free_irq(irq_usbd, udc);
|
free_irq(irq_usbd, udc);
|
||||||
err:
|
err_udc_clk:
|
||||||
|
clk_disable_unprepare(udc_clock);
|
||||||
|
clk_put(udc_clock);
|
||||||
|
udc_clock = NULL;
|
||||||
|
err_usb_bus_clk:
|
||||||
|
clk_disable_unprepare(usb_bus_clock);
|
||||||
|
clk_put(usb_bus_clock);
|
||||||
|
usb_bus_clock = NULL;
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user