]> err.no Git - linux-2.6/blobdiff - drivers/macintosh/via-pmu.c
Pull error-inject into release branch
[linux-2.6] / drivers / macintosh / via-pmu.c
index 7b7db5db50dcb39b899e84b7704a67413bc26ed4..1729d3fd7a11417ed63c784986290b9bba5b1a4c 100644 (file)
@@ -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();