]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
i2c: added a few missing gotos to add_children()
authorFelipe Balbi <felipe.balbi@nokia.com>
Tue, 30 Sep 2008 18:42:57 +0000 (21:42 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 1 Oct 2008 10:37:37 +0000 (13:37 +0300)
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 <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/chips/twl4030-core.c

index 4ea6444de76b1294f050faf7e27668659e9419b4..80cf2318e7d09910cd15c9e213d7fb08b6bf8487 100644 (file)
@@ -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;
                }
        }