diff options
Diffstat (limited to 'drivers/power/twl4030_charger.c')
-rw-r--r-- | drivers/power/twl4030_charger.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index fdad850c77d3..7cacbaa68efe 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/err.h> | ||
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | #include <linux/i2c/twl.h> | 21 | #include <linux/i2c/twl.h> |
@@ -479,8 +480,8 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) | |||
479 | 480 | ||
480 | INIT_WORK(&bci->work, twl4030_bci_usb_work); | 481 | INIT_WORK(&bci->work, twl4030_bci_usb_work); |
481 | 482 | ||
482 | bci->transceiver = usb_get_transceiver(); | 483 | bci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); |
483 | if (bci->transceiver != NULL) { | 484 | if (!IS_ERR_OR_NULL(bci->transceiver)) { |
484 | bci->usb_nb.notifier_call = twl4030_bci_usb_ncb; | 485 | bci->usb_nb.notifier_call = twl4030_bci_usb_ncb; |
485 | usb_register_notifier(bci->transceiver, &bci->usb_nb); | 486 | usb_register_notifier(bci->transceiver, &bci->usb_nb); |
486 | } | 487 | } |
@@ -507,9 +508,9 @@ static int __init twl4030_bci_probe(struct platform_device *pdev) | |||
507 | return 0; | 508 | return 0; |
508 | 509 | ||
509 | fail_unmask_interrupts: | 510 | fail_unmask_interrupts: |
510 | if (bci->transceiver != NULL) { | 511 | if (!IS_ERR_OR_NULL(bci->transceiver)) { |
511 | usb_unregister_notifier(bci->transceiver, &bci->usb_nb); | 512 | usb_unregister_notifier(bci->transceiver, &bci->usb_nb); |
512 | usb_put_transceiver(bci->transceiver); | 513 | usb_put_phy(bci->transceiver); |
513 | } | 514 | } |
514 | free_irq(bci->irq_bci, bci); | 515 | free_irq(bci->irq_bci, bci); |
515 | fail_bci_irq: | 516 | fail_bci_irq: |
@@ -538,9 +539,9 @@ static int __exit twl4030_bci_remove(struct platform_device *pdev) | |||
538 | twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, | 539 | twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff, |
539 | TWL4030_INTERRUPTS_BCIIMR2A); | 540 | TWL4030_INTERRUPTS_BCIIMR2A); |
540 | 541 | ||
541 | if (bci->transceiver != NULL) { | 542 | if (!IS_ERR_OR_NULL(bci->transceiver)) { |
542 | usb_unregister_notifier(bci->transceiver, &bci->usb_nb); | 543 | usb_unregister_notifier(bci->transceiver, &bci->usb_nb); |
543 | usb_put_transceiver(bci->transceiver); | 544 | usb_put_phy(bci->transceiver); |
544 | } | 545 | } |
545 | free_irq(bci->irq_bci, bci); | 546 | free_irq(bci->irq_bci, bci); |
546 | free_irq(bci->irq_chg, bci); | 547 | free_irq(bci->irq_chg, bci); |