Previously we were failing platform_device_add_data()
and returning from add_children but trying to keep going
when platform_device_add() fails.

Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
---
 drivers/i2c/chips/twl4030-core.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/chips/twl4030-core.c b/drivers/i2c/chips/twl4030-core.c
index 4ea6444..80cf231 100644
--- a/drivers/i2c/chips/twl4030-core.c
+++ b/drivers/i2c/chips/twl4030-core.c
@@ -675,6 +675,7 @@ static int add_children(struct twl4030_platform_data *pdata)
                if (!pdev) {
                        pr_debug("%s: can't alloc gpio dev\n", DRIVER_NAME);
                        status = -ENOMEM;
+                       goto err;
                }
 
                /* more driver model init */
@@ -735,6 +736,7 @@ static int add_children(struct twl4030_platform_data *pdata)
                                dev_dbg(&twl->client->dev,
                                                "can't create keypad dev, %d\n",
                                                status);
+                               goto err;
                        }
                } else {
                        pr_debug("%s: can't alloc keypad dev\n", DRIVER_NAME);
@@ -764,6 +766,7 @@ static int add_children(struct twl4030_platform_data *pdata)
                                dev_dbg(&twl->client->dev,
                                                "can't create madc dev, %d\n",
                                                status);
+                               goto err;
                        }
                } else {
                        pr_debug("%s: can't alloc madc dev\n", DRIVER_NAME);
@@ -799,6 +802,7 @@ static int add_children(struct twl4030_platform_data *pdata)
                                dev_dbg(&twl->client->dev,
                                                "can't create rtc dev, %d\n",
                                                status);
+                               goto err;
                        }
                } else {
                        pr_debug("%s: can't alloc rtc dev\n", DRIVER_NAME);
@@ -832,7 +836,6 @@ static int add_children(struct twl4030_platform_data *pdata)
                } else {
                        pr_debug("%s: can't alloc usb dev\n", DRIVER_NAME);
                        status = -ENOMEM;
-                       goto err;
                }
        }
 
-- 
1.6.0.2.307.gc427

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to