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 01/12] PCI: remove pci_find_present
Date: Thu, 14 Feb 2008 16:39:59 -0800	[thread overview]
Message-ID: <1203036010-27988-1-git-send-email-gregkh@suse.de> (raw)
In-Reply-To: <20080215003909.GA27981@kroah.com>

No one is using this function anymore for quite some time, so remove it.
Everyone calls pci_dev_present() instead anyway...

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

diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 8541034..1aabe3d 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -436,7 +436,18 @@ exit:
 	return dev;
 }
 
-const struct pci_device_id *pci_find_present(const struct pci_device_id *ids)
+/**
+ * pci_dev_present - Returns 1 if device matching the device list is present, 0 if not.
+ * @ids: A pointer to a null terminated list of struct pci_device_id structures
+ * that describe the type of PCI device the caller is trying to find.
+ *
+ * Obvious fact: You do not have a reference to any device that might be found
+ * by this function, so if that device is removed from the system right after
+ * this function is finished, the value will be stale.  Use this function to
+ * find devices that are usually built into a system, or for a general hint as
+ * to if another device happens to be present at this specific moment in time.
+ */
+int pci_dev_present(const struct pci_device_id *ids)
 {
 	struct pci_dev *dev;
 	const struct pci_device_id *found = NULL;
@@ -452,27 +463,11 @@ const struct pci_device_id *pci_find_present(const struct pci_device_id *ids)
 	}
 exit:
 	up_read(&pci_bus_sem);
-	return found;
-}
-
-/**
- * pci_dev_present - Returns 1 if device matching the device list is present, 0 if not.
- * @ids: A pointer to a null terminated list of struct pci_device_id structures
- * that describe the type of PCI device the caller is trying to find.
- *
- * Obvious fact: You do not have a reference to any device that might be found
- * by this function, so if that device is removed from the system right after
- * this function is finished, the value will be stale.  Use this function to
- * find devices that are usually built into a system, or for a general hint as
- * to if another device happens to be present at this specific moment in time.
- */
-int pci_dev_present(const struct pci_device_id *ids)
-{
-	return pci_find_present(ids) == NULL ? 0 : 1;
+	if (found)
+		return 1;
+	return 0;
 }
-
 EXPORT_SYMBOL(pci_dev_present);
-EXPORT_SYMBOL(pci_find_present);
 
 #ifdef CONFIG_PCI_LEGACY
 EXPORT_SYMBOL(pci_find_device);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 87195b6..8eebbff 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -517,7 +517,6 @@ struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
 struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
 int pci_dev_present(const struct pci_device_id *ids);
-const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
 
 int pci_bus_read_config_byte(struct pci_bus *bus, unsigned int devfn,
 			     int where, u8 *val);
@@ -807,7 +806,6 @@ static inline struct pci_dev *pci_get_class(unsigned int class,
 
 #define pci_dev_present(ids)	(0)
 #define no_pci_devices()	(1)
-#define pci_find_present(ids)	(NULL)
 #define pci_dev_put(dev)	do { } while (0)
 
 static inline void pci_set_master(struct pci_dev *dev)
-- 
1.5.4


  reply	other threads:[~2008-02-15  0:42 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 ` Greg Kroah-Hartman [this message]
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 ` [PATCH 04/12] PCI: remove pci_get_device_reverse Greg Kroah-Hartman
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-1-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 01/12] PCI: remove pci_find_present' \
    /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).