Merge tag 'spi-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc
[deliverable/linux.git] / drivers / power / pda_power.c
index 214468f4444a0d68e61468dc19f8ec1abf56b40b..8dbcd53c5e67b2a8868de2028169139e0472a74e 100644 (file)
@@ -321,12 +321,12 @@ static int pda_power_probe(struct platform_device *pdev)
        }
 
 #ifdef CONFIG_USB_OTG_UTILS
-       transceiver = usb_get_transceiver();
-       if (transceiver && !pdata->is_usb_online) {
-               pdata->is_usb_online = otg_is_usb_online;
-       }
-       if (transceiver && !pdata->is_ac_online) {
-               pdata->is_ac_online = otg_is_ac_online;
+       transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
+       if (!IS_ERR_OR_NULL(transceiver)) {
+               if (!pdata->is_usb_online)
+                       pdata->is_usb_online = otg_is_usb_online;
+               if (!pdata->is_ac_online)
+                       pdata->is_ac_online = otg_is_ac_online;
        }
 #endif
 
@@ -373,7 +373,7 @@ static int pda_power_probe(struct platform_device *pdev)
        }
 
 #ifdef CONFIG_USB_OTG_UTILS
-       if (transceiver && pdata->use_otg_notifier) {
+       if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier) {
                otg_nb.notifier_call = otg_handle_notification;
                ret = usb_register_notifier(transceiver, &otg_nb);
                if (ret) {
@@ -408,8 +408,8 @@ usb_supply_failed:
        if (pdata->is_ac_online && ac_irq)
                free_irq(ac_irq->start, &pda_psy_ac);
 #ifdef CONFIG_USB_OTG_UTILS
-       if (transceiver)
-               usb_put_transceiver(transceiver);
+       if (!IS_ERR_OR_NULL(transceiver))
+               usb_put_phy(transceiver);
 #endif
 ac_irq_failed:
        if (pdata->is_ac_online)
@@ -443,8 +443,8 @@ static int pda_power_remove(struct platform_device *pdev)
        if (pdata->is_ac_online)
                power_supply_unregister(&pda_psy_ac);
 #ifdef CONFIG_USB_OTG_UTILS
-       if (transceiver)
-               usb_put_transceiver(transceiver);
+       if (!IS_ERR_OR_NULL(transceiver))
+               usb_put_phy(transceiver);
 #endif
        if (ac_draw) {
                regulator_put(ac_draw);
This page took 0.025022 seconds and 5 git commands to generate.