aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/platform.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index c794fec1c435..3966e62ad019 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -380,17 +380,13 @@ struct platform_device *__init_or_module platform_device_register_resndata(
380 380
381 pdev->dev.parent = parent; 381 pdev->dev.parent = parent;
382 382
383 if (res) { 383 ret = platform_device_add_resources(pdev, res, num);
384 ret = platform_device_add_resources(pdev, res, num); 384 if (ret)
385 if (ret) 385 goto err;
386 goto err;
387 }
388 386
389 if (data) { 387 ret = platform_device_add_data(pdev, data, size);
390 ret = platform_device_add_data(pdev, data, size); 388 if (ret)
391 if (ret) 389 goto err;
392 goto err;
393 }
394 390
395 ret = platform_device_add(pdev); 391 ret = platform_device_add(pdev);
396 if (ret) { 392 if (ret) {
@@ -537,17 +533,13 @@ struct platform_device * __init_or_module platform_create_bundle(
537 goto err_out; 533 goto err_out;
538 } 534 }
539 535
540 if (res) { 536 error = platform_device_add_resources(pdev, res, n_res);
541 error = platform_device_add_resources(pdev, res, n_res); 537 if (error)
542 if (error) 538 goto err_pdev_put;
543 goto err_pdev_put;
544 }
545 539
546 if (data) { 540 error = platform_device_add_data(pdev, data, size);
547 error = platform_device_add_data(pdev, data, size); 541 if (error)
548 if (error) 542 goto err_pdev_put;
549 goto err_pdev_put;
550 }
551 543
552 error = platform_device_add(pdev); 544 error = platform_device_add(pdev);
553 if (error) 545 if (error)