LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: linux-pci@atrey.karlin.mff.cuni.cz
Cc: linux-kernel@vger.kernel.org,
	pcihpd-discuss@lists.sourceforge.net,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 04/12] PCI: remove pci_get_device_reverse
Date: Thu, 14 Feb 2008 16:40:02 -0800	[thread overview]
Message-ID: <1203036010-27988-4-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20080215003909.GA27981@kroah.com>

This removes the pci_get_device_reverse function as there should not be
any need to walk pci devices backwards anymore.  All users of this call
are now gone from the tree, so it is safe to remove it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/pci/search.c |   41 -----------------------------------------
 include/linux/pci.h  |   10 ----------
 2 files changed, 0 insertions(+), 51 deletions(-)

diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 1aabe3d..a04c43f 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -360,46 +360,6 @@ pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from)
 }
 
 /**
- * pci_get_device_reverse - begin or continue searching for a PCI device by vendor/device id
- * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
- * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
- * @from: Previous PCI device found in search, or %NULL for new search.
- *
- * Iterates through the list of known PCI devices in the reverse order of
- * pci_get_device.
- * If a PCI device is found with a matching @vendor and @device, the reference
- * count to the  device is incremented and a pointer to its device structure
- * is returned Otherwise, %NULL is returned.  A new search is initiated by
- * passing %NULL as the @from argument.  Otherwise if @from is not %NULL,
- * searches continue from next device on the global list.  The reference
- * count for @from is always decremented if it is not %NULL.
- */
-struct pci_dev *
-pci_get_device_reverse(unsigned int vendor, unsigned int device, struct pci_dev *from)
-{
-	struct list_head *n;
-	struct pci_dev *dev;
-
-	WARN_ON(in_interrupt());
-	down_read(&pci_bus_sem);
-	n = from ? from->global_list.prev : pci_devices.prev;
-
-	while (n && (n != &pci_devices)) {
-		dev = pci_dev_g(n);
-		if ((vendor == PCI_ANY_ID || dev->vendor == vendor) &&
-		    (device == PCI_ANY_ID || dev->device == device))
-			goto exit;
-		n = n->prev;
-	}
-	dev = NULL;
-exit:
-	dev = pci_dev_get(dev);
-	up_read(&pci_bus_sem);
-	pci_dev_put(from);
-	return dev;
-}
-
-/**
  * pci_get_class - begin or continue searching for a PCI device by class
  * @class: search for a PCI device with this class designation
  * @from: Previous PCI device found in search, or %NULL for new search.
@@ -479,7 +439,6 @@ EXPORT_SYMBOL(pci_find_bus);
 EXPORT_SYMBOL(pci_find_next_bus);
 /* For everyone */
 EXPORT_SYMBOL(pci_get_device);
-EXPORT_SYMBOL(pci_get_device_reverse);
 EXPORT_SYMBOL(pci_get_subsys);
 EXPORT_SYMBOL(pci_get_slot);
 EXPORT_SYMBOL(pci_get_bus_and_slot);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8eebbff..99cd9b2 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -507,9 +507,6 @@ struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
 
 struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
 				struct pci_dev *from);
-struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
-				struct pci_dev *from);
-
 struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 				unsigned int ss_vendor, unsigned int ss_device,
 				struct pci_dev *from);
@@ -782,13 +779,6 @@ static inline struct pci_dev *pci_get_device(unsigned int vendor,
 	return NULL;
 }
 
-static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
-						     unsigned int device,
-						     struct pci_dev *from)
-{
-	return NULL;
-}
-
 static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
 					     unsigned int device,
 					     unsigned int ss_vendor,
-- 
1.5.4


  parent reply	other threads:[~2008-02-15  0:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15  0:39 [RFC] PCI: remove the "shadow" device list Greg KH
2008-02-15  0:39 ` [PATCH 01/12] PCI: remove pci_find_present Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 02/12] PCI: remove pci_get_device_reverse from calgary driver Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 03/12] IDE: remove ide=reverse IDE core Greg Kroah-Hartman
2008-02-15  0:40 ` Greg Kroah-Hartman [this message]
2008-02-15  0:40 ` [PATCH 05/12] PCI: clean up search.c a lot Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 06/12] PCI Hotplug: make cpcihp driver use modern apis Greg Kroah-Hartman
2008-02-15 22:45   ` Scott Murray
2008-02-19 19:32     ` [Pcihpd-discuss] " Greg KH
2008-02-15  0:40 ` [PATCH 07/12] PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 08/12] PCI: remove initial bios sort of PCI devices on x86 Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 09/12] PCI: make no_pci_devices() use the pci_bus_type list Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 10/12] PCI: add is_added flag to struct pci_dev Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 11/12] PCI: remove pcibious_fixup_ghosts() Greg Kroah-Hartman
2008-02-15  0:40 ` [PATCH 12/12] PCI: remove global list of PCI devices Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1203036010-27988-4-git-send-email-gregkh@suse.de \
    --to=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=pcihpd-discuss@lists.sourceforge.net \
    --subject='Re: [PATCH 04/12] PCI: remove pci_get_device_reverse' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).