aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/via-pmu.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-01 02:27:32 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:21 -0400
commitedceeaf50be1764db4aa7c1b19e540067a051e77 (patch)
tree28ea98a31821c94ab0d315ca59cf015b1d4a1699 /drivers/macintosh/via-pmu.c
parent40cddf2cbd02aa830254afcd5a1a21b4e882a189 (diff)
[PATCH] via* : switch to pci_get_device refcounted PCI API
If we can clean up these remainders we can finally delete pci_find_* Signed-off-by: Alan Cox <alan@redhat.com> Cc: Greg KH <greg@kroah.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/macintosh/via-pmu.c')
-rw-r--r--drivers/macintosh/via-pmu.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index dda03985dcf5..80b89649e676 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1827,7 +1827,7 @@ pbook_alloc_pci_save(void)
1827 struct pci_dev *pd = NULL; 1827 struct pci_dev *pd = NULL;
1828 1828
1829 npci = 0; 1829 npci = 0;
1830 while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { 1830 while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
1831 ++npci; 1831 ++npci;
1832 } 1832 }
1833 if (npci == 0) 1833 if (npci == 0)
@@ -1857,9 +1857,11 @@ pbook_pci_save(void)
1857 if (ps == NULL) 1857 if (ps == NULL)
1858 return; 1858 return;
1859 1859
1860 while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { 1860 while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
1861 if (npci-- == 0) 1861 if (npci-- == 0) {
1862 pci_dev_put(pd);
1862 return; 1863 return;
1864 }
1863#ifndef HACKED_PCI_SAVE 1865#ifndef HACKED_PCI_SAVE
1864 pci_read_config_word(pd, PCI_COMMAND, &ps->command); 1866 pci_read_config_word(pd, PCI_COMMAND, &ps->command);
1865 pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); 1867 pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
@@ -1887,11 +1889,13 @@ pbook_pci_restore(void)
1887 int npci = pbook_npci_saves; 1889 int npci = pbook_npci_saves;
1888 int j; 1890 int j;
1889 1891
1890 while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { 1892 while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
1891#ifdef HACKED_PCI_SAVE 1893#ifdef HACKED_PCI_SAVE
1892 int i; 1894 int i;
1893 if (npci-- == 0) 1895 if (npci-- == 0) {
1896 pci_dev_put(pd);
1894 return; 1897 return;
1898 }
1895 ps++; 1899 ps++;
1896 for (i=2;i<16;i++) 1900 for (i=2;i<16;i++)
1897 pci_write_config_dword(pd, i<<4, ps->config[i]); 1901 pci_write_config_dword(pd, i<<4, ps->config[i]);