]> err.no Git - linux-2.6/blobdiff - drivers/macintosh/via-pmu.c
Pull thermal into release branch
[linux-2.6] / drivers / macintosh / via-pmu.c
index 7b7db5db50dcb39b899e84b7704a67413bc26ed4..157080b3b4688206eca50c71fc498aeeaf765c1f 100644 (file)
@@ -310,14 +310,14 @@ int __init find_via_pmu(void)
                        PMU_INT_TICK;
        
        if (vias->parent->name && ((strcmp(vias->parent->name, "ohare") == 0)
-           || device_is_compatible(vias->parent, "ohare")))
+           || of_device_is_compatible(vias->parent, "ohare")))
                pmu_kind = PMU_OHARE_BASED;
-       else if (device_is_compatible(vias->parent, "paddington"))
+       else if (of_device_is_compatible(vias->parent, "paddington"))
                pmu_kind = PMU_PADDINGTON_BASED;
-       else if (device_is_compatible(vias->parent, "heathrow"))
+       else if (of_device_is_compatible(vias->parent, "heathrow"))
                pmu_kind = PMU_HEATHROW_BASED;
-       else if (device_is_compatible(vias->parent, "Keylargo")
-                || device_is_compatible(vias->parent, "K2-Keylargo")) {
+       else if (of_device_is_compatible(vias->parent, "Keylargo")
+                || of_device_is_compatible(vias->parent, "K2-Keylargo")) {
                struct device_node *gpiop;
                struct device_node *adbp;
                u64 gaddr = OF_BAD_ADDR;
@@ -487,7 +487,8 @@ static int __init via_pmu_dev_init(void)
                pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART;
                pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;
        } else {
-               struct device_node* prim = find_devices("power-mgt");
+               struct device_node* prim =
+                       of_find_node_by_name(NULL, "power-mgt");
                const u32 *prim_info = NULL;
                if (prim)
                        prim_info = of_get_property(prim, "prim-info", NULL);
@@ -498,6 +499,7 @@ static int __init via_pmu_dev_init(void)
                        if (pmu_battery_count > 1)
                                pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;
                }
+               of_node_put(prim);
        }
 #endif /* CONFIG_PPC32 */
 
@@ -2133,7 +2135,7 @@ static int powerbook_sleep_grackle(void)
        int ret;
        struct pci_dev *grackle;
 
-       grackle = pci_find_slot(0, 0);
+       grackle = pci_get_bus_and_slot(0, 0);
        if (!grackle)
                return -ENODEV;
 
@@ -2181,6 +2183,8 @@ static int powerbook_sleep_grackle(void)
        pmcr1 &= ~(GRACKLE_PM|GRACKLE_DOZE|GRACKLE_SLEEP|GRACKLE_NAP); 
        pci_write_config_word(grackle, 0x70, pmcr1);
 
+       pci_dev_put(grackle);
+
        /* Make sure the PMU is idle */
        pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
        restore_via_state();
@@ -2755,7 +2759,7 @@ pmu_polled_request(struct adb_request *req)
 
 #if defined(CONFIG_PM) && defined(CONFIG_PPC32)
 
-static int pmu_sys_suspended;
+int pmu_sys_suspended;
 
 static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
 {