diff options
Diffstat (limited to 'drivers/power/lp8727_charger.c')
-rw-r--r-- | drivers/power/lp8727_charger.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c index 0d3cb1de2eb1..b2df11458d98 100644 --- a/drivers/power/lp8727_charger.c +++ b/drivers/power/lp8727_charger.c | |||
@@ -442,35 +442,33 @@ static int lp8727_probe(struct i2c_client *cl, const struct i2c_device_id *id) | |||
442 | ret = lp8727_init_device(pchg); | 442 | ret = lp8727_init_device(pchg); |
443 | if (ret) { | 443 | if (ret) { |
444 | dev_err(pchg->dev, "i2c communication err: %d", ret); | 444 | dev_err(pchg->dev, "i2c communication err: %d", ret); |
445 | goto error; | 445 | return ret; |
446 | } | 446 | } |
447 | 447 | ||
448 | ret = lp8727_intr_config(pchg); | 448 | ret = lp8727_register_psy(pchg); |
449 | if (ret) { | 449 | if (ret) { |
450 | dev_err(pchg->dev, "irq handler err: %d", ret); | 450 | dev_err(pchg->dev, "power supplies register err: %d", ret); |
451 | goto error; | 451 | return ret; |
452 | } | 452 | } |
453 | 453 | ||
454 | ret = lp8727_register_psy(pchg); | 454 | ret = lp8727_intr_config(pchg); |
455 | if (ret) { | 455 | if (ret) { |
456 | dev_err(pchg->dev, "power supplies register err: %d", ret); | 456 | dev_err(pchg->dev, "irq handler err: %d", ret); |
457 | goto error; | 457 | lp8727_unregister_psy(pchg); |
458 | return ret; | ||
458 | } | 459 | } |
459 | 460 | ||
460 | return 0; | 461 | return 0; |
461 | |||
462 | error: | ||
463 | return ret; | ||
464 | } | 462 | } |
465 | 463 | ||
466 | static int __devexit lp8727_remove(struct i2c_client *cl) | 464 | static int __devexit lp8727_remove(struct i2c_client *cl) |
467 | { | 465 | { |
468 | struct lp8727_chg *pchg = i2c_get_clientdata(cl); | 466 | struct lp8727_chg *pchg = i2c_get_clientdata(cl); |
469 | 467 | ||
470 | lp8727_unregister_psy(pchg); | ||
471 | free_irq(pchg->client->irq, pchg); | 468 | free_irq(pchg->client->irq, pchg); |
472 | flush_workqueue(pchg->irqthread); | 469 | flush_workqueue(pchg->irqthread); |
473 | destroy_workqueue(pchg->irqthread); | 470 | destroy_workqueue(pchg->irqthread); |
471 | lp8727_unregister_psy(pchg); | ||
474 | return 0; | 472 | return 0; |
475 | } | 473 | } |
476 | 474 | ||