]> Pileus Git - ~andy/linux/blobdiff - drivers/power/pda_power.c
Merge branch 'multitouch' into for-linus
[~andy/linux] / drivers / power / pda_power.c
index ed54a3551148481c60ca6fb061d005cb65ccbee0..7312f2651647fbb97e64caa56fe03e778f2508a0 100644 (file)
 
 static inline unsigned int get_irq_flags(struct resource *res)
 {
-       unsigned int flags = IRQF_SAMPLE_RANDOM | IRQF_SHARED;
-
-       flags |= res->flags & IRQF_TRIGGER_MASK;
-
-       return flags;
+       return IRQF_SHARED | (res->flags & IRQF_TRIGGER_MASK);
 }
 
 static struct device *dev;
@@ -321,12 +317,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 +369,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 +404,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 +439,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);