Skip to contentSkip to conversation

via-pmu: Switch to ref counting PCI API

PATCH New Alan Cox 1 participant 1 message Apr 23, 2007 Linux for power macintosh

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 via-pmu: Switch to ref counting PCI API

drivers/macintosh/via-pmu.c +3 -1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc6-mm1/drivers/macintosh/via-pmu.c linux-2.6.21-rc6-mm1/drivers/macintosh/via-pmu.c
@@ -2130,7 +2130,7 @@
 	int ret;
 	struct pci_dev *grackle;
 
-	grackle = pci_find_slot(0, 0);
+	grackle = pci_get_bus_and_slot(0, 0);
 	if (!grackle)
 		return -ENODEV;
 
@@ -2177,6 +2177,8 @@
 	pci_read_config_word(grackle, 0x70, &pmcr1);
 	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);