Commit edceeaf50be1764db4aa7c1b19e540067a051e77

Authored by Alan Cox
Committed by Linus Torvalds
1 parent 40cddf2cbd

[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>

Showing 2 changed files with 12 additions and 8 deletions Side-by-side Diff

drivers/macintosh/via-pmu.c
... ... @@ -1827,7 +1827,7 @@
1827 1827 struct pci_dev *pd = NULL;
1828 1828  
1829 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 1831 ++npci;
1832 1832 }
1833 1833 if (npci == 0)
1834 1834  
... ... @@ -1857,9 +1857,11 @@
1857 1857 if (ps == NULL)
1858 1858 return;
1859 1859  
1860   - while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
1861   - if (npci-- == 0)
  1860 + while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
  1861 + if (npci-- == 0) {
  1862 + pci_dev_put(pd);
1862 1863 return;
  1864 + }
1863 1865 #ifndef HACKED_PCI_SAVE
1864 1866 pci_read_config_word(pd, PCI_COMMAND, &ps->command);
1865 1867 pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
1866 1868  
1867 1869  
... ... @@ -1887,11 +1889,13 @@
1887 1889 int npci = pbook_npci_saves;
1888 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 1893 #ifdef HACKED_PCI_SAVE
1892 1894 int i;
1893   - if (npci-- == 0)
  1895 + if (npci-- == 0) {
  1896 + pci_dev_put(pd);
1894 1897 return;
  1898 + }
1895 1899 ps++;
1896 1900 for (i=2;i<16;i++)
1897 1901 pci_write_config_dword(pd, i<<4, ps->config[i]);
drivers/macintosh/via-pmu68k.c
... ... @@ -843,7 +843,7 @@
843 843 struct pci_save *ps;
844 844  
845 845 npci = 0;
846   - while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL)
  846 + while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL)
847 847 ++npci;
848 848 n_pbook_pci_saves = npci;
849 849 if (npci == 0)
... ... @@ -854,7 +854,7 @@
854 854 return;
855 855  
856 856 pd = NULL;
857   - while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
  857 + while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
858 858 pci_read_config_word(pd, PCI_COMMAND, &ps->command);
859 859 pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
860 860 pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
... ... @@ -871,7 +871,7 @@
871 871 struct pci_dev *pd = NULL;
872 872 int j;
873 873  
874   - while ((pd = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
  874 + while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
875 875 if (ps->command == 0)
876 876 continue;
877 877 pci_read_config_word(pd, PCI_COMMAND, &cmd);