diff options
Diffstat (limited to 'drivers/w1/slaves')
-rw-r--r-- | drivers/w1/slaves/w1_bq27000.c | 4 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2760.c | 3 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2780.c | 3 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2781.c | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/drivers/w1/slaves/w1_bq27000.c b/drivers/w1/slaves/w1_bq27000.c index 773dca5beafe..afbefed5f2c9 100644 --- a/drivers/w1/slaves/w1_bq27000.c +++ b/drivers/w1/slaves/w1_bq27000.c @@ -57,6 +57,8 @@ static int w1_bq27000_add_slave(struct w1_slave *sl) ret = platform_device_add_data(pdev, &bq27000_battery_info, sizeof(bq27000_battery_info)); + if (ret) + goto pdev_add_failed; pdev->dev.parent = &sl->dev; ret = platform_device_add(pdev); @@ -68,7 +70,7 @@ static int w1_bq27000_add_slave(struct w1_slave *sl) goto success; pdev_add_failed: - platform_device_unregister(pdev); + platform_device_put(pdev); success: return ret; } diff --git a/drivers/w1/slaves/w1_ds2760.c b/drivers/w1/slaves/w1_ds2760.c index aa7bd5fa2fa8..e86a69dc411e 100644 --- a/drivers/w1/slaves/w1_ds2760.c +++ b/drivers/w1/slaves/w1_ds2760.c @@ -148,8 +148,9 @@ static int w1_ds2760_add_slave(struct w1_slave *sl) goto success; bin_attr_failed: + platform_device_del(pdev); pdev_add_failed: - platform_device_unregister(pdev); + platform_device_put(pdev); pdev_alloc_failed: ida_simple_remove(&bat_ida, id); noid: diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c index 7b09307de0ef..98ed9c49cf50 100644 --- a/drivers/w1/slaves/w1_ds2780.c +++ b/drivers/w1/slaves/w1_ds2780.c @@ -141,8 +141,9 @@ static int w1_ds2780_add_slave(struct w1_slave *sl) return 0; bin_attr_failed: + platform_device_del(pdev); pdev_add_failed: - platform_device_unregister(pdev); + platform_device_put(pdev); pdev_alloc_failed: ida_simple_remove(&bat_ida, id); noid: diff --git a/drivers/w1/slaves/w1_ds2781.c b/drivers/w1/slaves/w1_ds2781.c index 877daf74159c..5140d7be67ab 100644 --- a/drivers/w1/slaves/w1_ds2781.c +++ b/drivers/w1/slaves/w1_ds2781.c @@ -139,8 +139,9 @@ static int w1_ds2781_add_slave(struct w1_slave *sl) return 0; bin_attr_failed: + platform_device_del(pdev); pdev_add_failed: - platform_device_unregister(pdev); + platform_device_put(pdev); pdev_alloc_failed: ida_simple_remove(&bat_ida, id); noid: |