diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa-pci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa-pci.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index 6659d269b84..632e088760a 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c @@ -3,6 +3,7 @@ * It does not support slave mode, the register slightly moved. This PCI * device provides three bars, every contains a single I2C controller. */ +#include <linux/module.h> #include <linux/pci.h> #include <linux/platform_device.h> #include <linux/i2c/pxa-i2c.h> @@ -109,12 +110,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; |