Commit edceeaf5 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[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: default avatarAlan Cox <alan@redhat.com>
Cc: Greg KH <greg@kroah.com>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 40cddf2c
...@@ -1827,7 +1827,7 @@ pbook_alloc_pci_save(void) ...@@ -1827,7 +1827,7 @@ pbook_alloc_pci_save(void)
struct pci_dev *pd = NULL; struct pci_dev *pd = NULL;
npci = 0; npci = 0;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
++npci; ++npci;
} }
if (npci == 0) if (npci == 0)
...@@ -1857,9 +1857,11 @@ pbook_pci_save(void) ...@@ -1857,9 +1857,11 @@ pbook_pci_save(void)
if (ps == NULL) if (ps == NULL)
return; return;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
if (npci-- == 0) if (npci-- == 0) {
pci_dev_put(pd);
return; return;
}
#ifndef HACKED_PCI_SAVE #ifndef HACKED_PCI_SAVE
pci_read_config_word(pd, PCI_COMMAND, &ps->command); pci_read_config_word(pd, PCI_COMMAND, &ps->command);
pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
...@@ -1887,11 +1889,13 @@ pbook_pci_restore(void) ...@@ -1887,11 +1889,13 @@ pbook_pci_restore(void)
int npci = pbook_npci_saves; int npci = pbook_npci_saves;
int j; int j;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
#ifdef HACKED_PCI_SAVE #ifdef HACKED_PCI_SAVE
int i; int i;
if (npci-- == 0) if (npci-- == 0) {
pci_dev_put(pd);
return; return;
}
ps++; ps++;
for (i=2;i<16;i++) for (i=2;i<16;i++)
pci_write_config_dword(pd, i<<4, ps->config[i]); pci_write_config_dword(pd, i<<4, ps->config[i]);
......
...@@ -843,7 +843,7 @@ pbook_pci_save(void) ...@@ -843,7 +843,7 @@ pbook_pci_save(void)
struct pci_save *ps; struct pci_save *ps;
npci = 0; npci = 0;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL)
++npci; ++npci;
n_pbook_pci_saves = npci; n_pbook_pci_saves = npci;
if (npci == 0) if (npci == 0)
...@@ -854,7 +854,7 @@ pbook_pci_save(void) ...@@ -854,7 +854,7 @@ pbook_pci_save(void)
return; return;
pd = NULL; pd = NULL;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
pci_read_config_word(pd, PCI_COMMAND, &ps->command); pci_read_config_word(pd, PCI_COMMAND, &ps->command);
pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr); pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
...@@ -871,7 +871,7 @@ pbook_pci_restore(void) ...@@ -871,7 +871,7 @@ pbook_pci_restore(void)
struct pci_dev *pd = NULL; struct pci_dev *pd = NULL;
int j; int j;
while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
if (ps->command == 0) if (ps->command == 0)
continue; continue;
pci_read_config_word(pd, PCI_COMMAND, &cmd); pci_read_config_word(pd, PCI_COMMAND, &cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment