diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-07-29 04:28:25 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-08-12 05:28:01 -0400 |
commit | 48736c80e5d0c7c9db97bd6643a979a4ab11f25b (patch) | |
tree | 48652b4fd0284dfc7ed871e45c423b0b06ab4a09 /drivers/mfd | |
parent | 889135210b794df9cea4b1e94dff78c264edc5e7 (diff) |
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 <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/jz4740-adc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mfd/jz4740-adc.c b/drivers/mfd/jz4740-adc.c index 7a844aef5dcf..b30e44ac4d1c 100644 --- a/drivers/mfd/jz4740-adc.c +++ b/drivers/mfd/jz4740-adc.c | |||
@@ -322,9 +322,15 @@ static int __devinit jz4740_adc_probe(struct platform_device *pdev) | |||
322 | writeb(0x00, adc->base + JZ_REG_ADC_ENABLE); | 322 | writeb(0x00, adc->base + JZ_REG_ADC_ENABLE); |
323 | writeb(0xff, adc->base + JZ_REG_ADC_CTRL); | 323 | writeb(0xff, adc->base + JZ_REG_ADC_CTRL); |
324 | 324 | ||
325 | return mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells, | 325 | ret = mfd_add_devices(&pdev->dev, 0, jz4740_adc_cells, |
326 | ARRAY_SIZE(jz4740_adc_cells), mem_base, adc->irq_base); | 326 | ARRAY_SIZE(jz4740_adc_cells), mem_base, adc->irq_base); |
327 | if (ret < 0) | ||
328 | goto err_clk_put; | ||
327 | 329 | ||
330 | return 0; | ||
331 | |||
332 | err_clk_put: | ||
333 | clk_put(adc->clk); | ||
328 | err_iounmap: | 334 | err_iounmap: |
329 | platform_set_drvdata(pdev, NULL); | 335 | platform_set_drvdata(pdev, NULL); |
330 | iounmap(adc->base); | 336 | iounmap(adc->base); |