projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8891352
)
mfd: Fix jz4740-adc resource reclaim in probe error path
author
Axel Lin
<
[email protected]
>
Thu, 29 Jul 2010 08:28:25 +0000
(16:28 +0800)
committer
Samuel Ortiz
<
[email protected]
>
Thu, 12 Aug 2010 09:28:01 +0000
(11:28 +0200)
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]
>
drivers/mfd/jz4740-adc.c
patch
|
blob
|
history
diff --git
a/drivers/mfd/jz4740-adc.c
b/drivers/mfd/jz4740-adc.c
index 7a844aef5dcf70689fc54dc97a3740630a5d6d41..b30e44ac4d1c5bbef20d48df9643ebc620c70eef 100644
(file)
--- 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)
writeb(0x00, adc->base + JZ_REG_ADC_ENABLE);
writeb(0xff, adc->base + JZ_REG_ADC_CTRL);
- ret
urn
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);