mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mfd: Fix jz4740-adc resource reclaim in probe error path
If mfd_add_devices() fail, we need to relese allocated resources. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
889135210b
commit
48736c80e5
1 changed files with 7 additions and 1 deletions
|
|
@ -322,9 +322,15 @@ static int __devinit jz4740_adc_probe(struct platform_device *pdev)
|
|||
writeb(0x00, adc->base + JZ_REG_ADC_ENABLE);
|
||||
writeb(0xff, adc->base + JZ_REG_ADC_CTRL);
|
||||
|
||||
return mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells,
|
||||
ret = mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells,
|
||||
ARRAY_SIZE(jz4740_adc_cells), mem_base, adc->irq_base);
|
||||
if (ret < 0)
|
||||
goto err_clk_put;
|
||||
|
||||
return 0;
|
||||
|
||||
err_clk_put:
|
||||
clk_put(adc->clk);
|
||||
err_iounmap:
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
iounmap(adc->base);
|
||||
|
|
|
|||
Loading…
Reference in a new issue