diff options
Diffstat (limited to 'drivers/power/88pm860x_battery.c')
-rw-r--r-- | drivers/power/88pm860x_battery.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/power/88pm860x_battery.c b/drivers/power/88pm860x_battery.c index 8bc80b05c63c..d338c1c4e8c8 100644 --- a/drivers/power/88pm860x_battery.c +++ b/drivers/power/88pm860x_battery.c @@ -915,15 +915,13 @@ static int pm860x_battery_probe(struct platform_device *pdev) info->irq_cc = platform_get_irq(pdev, 0); if (info->irq_cc <= 0) { dev_err(&pdev->dev, "No IRQ resource!\n"); - ret = -EINVAL; - goto out; + return -EINVAL; } info->irq_batt = platform_get_irq(pdev, 1); if (info->irq_batt <= 0) { dev_err(&pdev->dev, "No IRQ resource!\n"); - ret = -EINVAL; - goto out; + return -EINVAL; } info->chip = chip; @@ -957,7 +955,7 @@ static int pm860x_battery_probe(struct platform_device *pdev) ret = power_supply_register(&pdev->dev, &info->battery); if (ret) - goto out; + return ret; info->battery.dev->parent = &pdev->dev; ret = request_threaded_irq(info->irq_cc, NULL, @@ -984,8 +982,6 @@ out_coulomb: free_irq(info->irq_cc, info); out_reg: power_supply_unregister(&info->battery); -out: - kfree(info); return ret; } @@ -993,10 +989,9 @@ static int pm860x_battery_remove(struct platform_device *pdev) { struct pm860x_battery_info *info = platform_get_drvdata(pdev); - power_supply_unregister(&info->battery); free_irq(info->irq_batt, info); free_irq(info->irq_cc, info); - kfree(info); + power_supply_unregister(&info->battery); platform_set_drvdata(pdev, NULL); return 0; } |