aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps6586x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/tps6586x.c')
-rw-r--r--drivers/mfd/tps6586x.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index bc6587194de9..2f9336c3710c 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -273,13 +273,19 @@ static int __devinit tps6586x_add_subdevs(struct tps6586x *tps6586x,
273 subdev = &pdata->subdevs[i]; 273 subdev = &pdata->subdevs[i];
274 274
275 pdev = platform_device_alloc(subdev->name, subdev->id); 275 pdev = platform_device_alloc(subdev->name, subdev->id);
276 if (!pdev) {
277 ret = -ENOMEM;
278 goto failed;
279 }
276 280
277 pdev->dev.parent = tps6586x->dev; 281 pdev->dev.parent = tps6586x->dev;
278 pdev->dev.platform_data = subdev->platform_data; 282 pdev->dev.platform_data = subdev->platform_data;
279 283
280 ret = platform_device_add(pdev); 284 ret = platform_device_add(pdev);
281 if (ret) 285 if (ret) {
286 platform_device_put(pdev);
282 goto failed; 287 goto failed;
288 }
283 } 289 }
284 return 0; 290 return 0;
285 291