diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-30 10:37:37 +0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-09-07 03:09:12 +0400 |
commit | 7a703aded97e01d7f4a6b8440a431117399666ba (patch) | |
tree | 804f07e574a38f575f8b6147e6fd9b2a2c18be5f | |
parent | 9e79e3e9dd9672b37ac9412e9a926714306551fe (diff) | |
download | linux-7a703aded97e01d7f4a6b8440a431117399666ba.tar.xz |
i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | drivers/i2c/busses/i2c-pxa-pci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index 6659d269b841..b73da6cd6f91 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c @@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev, return -EINVAL; } sds = kzalloc(sizeof(*sds), GFP_KERNEL); - if (!sds) + if (!sds) { + ret = -ENOMEM; goto err_mem; + } for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) { sds->pdev[i] = add_i2c_device(dev, i); if (IS_ERR(sds->pdev[i])) { + ret = PTR_ERR(sds->pdev[i]); while (--i >= 0) platform_device_unregister(sds->pdev[i]); goto err_dev_add; |