summaryrefslogtreecommitdiff
path: root/drivers/mfd/ezx-pcap.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 15:54:04 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 15:54:04 -0700
commitb779b332d0e1ef68f40867948ae5526a3e925163 (patch)
treed2fc8bb455d696fbdb288055ce0a4f0cfcee31fd /drivers/mfd/ezx-pcap.c
parenta0cadc2777a71b1fde62e6417284b38e52128e88 (diff)
parent0f48285755991b73c14b6eeeee464590f490ac25 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (73 commits) power: Revert "power_supply: Mark twl4030_charger as broken" mfd: Fix a memory leak when unload mc13xxx-core module mfd: Fix resource reclaim for max8998 mfd: Remove unneeded ret value checking for max8998 register updates mfd: Add free max8998->ono irq in max8998_irq_exit() mfd: Fix resource reclaim in pcf50633_remove() omap4: pandaboard: fix up mmc card detect logic mfd: Fix ezx_pcap_probe error path mfd: Fix off-by-one value range checking for tps6507x mfd: Remove __devinitdata from tc6393xb_mmc_resources mfd: Add WM831x SPI support mfd: Factor out WM831x I2C I/O from the core driver mfd: Remove DEBUG defines from mc13xxx-core mfd: Fix jz4740_adc_set_enabled mfd: Add TPS658621C device ID mfd: Fix twl-irq function declaration warnings regulator: max8998 BUCK1/2 voltage change with use of GPIOs mfd: Voltages and GPIOs platform_data definitions for max8998 regulator: max8998 BUCK1/2 internal voltages and indexes defined mfd: Support for ICs compliant with max8998 ...
Diffstat (limited to 'drivers/mfd/ezx-pcap.c')
-rw-r--r--drivers/mfd/ezx-pcap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 134c69aa4790..c2b698d69a93 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -384,12 +384,20 @@ static int __devinit pcap_add_subdev(struct pcap_chip *pcap,
struct pcap_subdev *subdev)
{
struct platform_device *pdev;
+ int ret;
pdev = platform_device_alloc(subdev->name, subdev->id);
+ if (!pdev)
+ return -ENOMEM;
+
pdev->dev.parent = &pcap->spi->dev;
pdev->dev.platform_data = subdev->platform_data;
- return platform_device_add(pdev);
+ ret = platform_device_add(pdev);
+ if (ret)
+ platform_device_put(pdev);
+
+ return ret;
}
static int __devexit ezx_pcap_remove(struct spi_device *spi)
@@ -457,6 +465,7 @@ static int __devinit ezx_pcap_probe(struct spi_device *spi)
pcap->irq_base = pdata->irq_base;
pcap->workqueue = create_singlethread_workqueue("pcapd");
if (!pcap->workqueue) {
+ ret = -ENOMEM;
dev_err(&spi->dev, "cant create pcap thread\n");
goto free_pcap;
}