Commit 0b6252bc authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI: remove direct access of pci_devices from drivers/macintosh/via-pmu68k.c

Yeah, this is commented out code, but just trying to be complete...
parent c83cdd9c
...@@ -839,11 +839,11 @@ static inline void __openfirmware ...@@ -839,11 +839,11 @@ static inline void __openfirmware
pbook_pci_save(void) pbook_pci_save(void)
{ {
int npci; int npci;
struct pci_dev *pd; struct pci_dev *pd = NULL;
struct pci_save *ps; struct pci_save *ps;
npci = 0; npci = 0;
for (pd = pci_devices; pd != NULL; pd = pd->next) while ((pd = pci_find_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)
...@@ -853,7 +853,8 @@ pbook_pci_save(void) ...@@ -853,7 +853,8 @@ pbook_pci_save(void)
if (ps == NULL) if (ps == NULL)
return; return;
for (pd = pci_devices; pd != NULL && npci != 0; pd = pd->next) { pd = NULL;
while ((pd = pci_find_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);
...@@ -867,10 +868,10 @@ pbook_pci_restore(void) ...@@ -867,10 +868,10 @@ pbook_pci_restore(void)
{ {
u16 cmd; u16 cmd;
struct pci_save *ps = pbook_pci_saves; struct pci_save *ps = pbook_pci_saves;
struct pci_dev *pd; struct pci_dev *pd = NULL;
int j; int j;
for (pd = pci_devices; pd != NULL; pd = pd->next, ++ps) { while ((pd = pci_find_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