All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Dittmer <jdittmer@ppp0.net>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org,
	Hotplug List <pcihpd-discuss@lists.sourceforge.net>
Subject: [patch 1/2] fakephp: introduce pci_bus_add_device
Date: Mon, 01 Nov 2004 00:59:54 +0100	[thread overview]
Message-ID: <41857C7A.2030007@ppp0.net> (raw)
In-Reply-To: <20041030041615.GH1584@kroah.com>

fakephp needs to add newly discovered devices to the global pci list.
Therefore seperate out the appropriate chunk from pci_bus_add_devices
to pci_bus_add_device to add a single device to sysfs, procfs
and the global device list.

Signed-off-by: Jan Dittmer <jdittmer@ppp0.net>

===== drivers/pci/bus.c 1.9 vs edited =====
--- 1.9/drivers/pci/bus.c       2004-04-11 00:27:59 +02:00
+++ edited/drivers/pci/bus.c    2004-10-31 23:24:10 +01:00
@@ -69,6 +69,24 @@
 }

 /**
+ * add a single device
+ * @dev: device to add
+ *
+ * This adds a single pci device to the global
+ * device list and adds sysfs and procfs entries for it
+ */
+void __devinit pci_bus_add_device(struct pci_dev *dev) {
+       device_add(&dev->dev);
+
+       spin_lock(&pci_bus_lock);
+       list_add_tail(&dev->global_list, &pci_devices);
+       spin_unlock(&pci_bus_lock);
+
+       pci_proc_attach_device(dev);
+       pci_create_sysfs_dev_files(dev);
+}
+
+/**
  * pci_bus_add_devices - insert newly discovered PCI devices
  * @bus: bus to check for new devices
  *
@@ -91,16 +109,7 @@
                 */
                if (!list_empty(&dev->global_list))
                        continue;
-
-               device_add(&dev->dev);
-
-               spin_lock(&pci_bus_lock);
-               list_add_tail(&dev->global_list, &pci_devices);
-               spin_unlock(&pci_bus_lock);
-
-               pci_proc_attach_device(dev);
-               pci_create_sysfs_dev_files(dev);
-
+               pci_bus_add_device(dev);
        }

        list_for_each_entry(dev, &bus->devices, bus_list) {
@@ -136,5 +145,6 @@
 }

 EXPORT_SYMBOL(pci_bus_alloc_resource);
+EXPORT_SYMBOL(pci_bus_add_device);
 EXPORT_SYMBOL(pci_bus_add_devices);
 EXPORT_SYMBOL(pci_enable_bridges);
===== include/linux/pci.h 1.139 vs edited =====
--- 1.139/include/linux/pci.h   2004-10-06 00:56:26 +02:00
+++ edited/include/linux/pci.h  2004-10-31 23:10:04 +01:00
@@ -713,6 +713,7 @@
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
 unsigned int pci_scan_child_bus(struct pci_bus *bus);
+void pci_bus_add_device(struct pci_dev *dev);
 void pci_bus_add_devices(struct pci_bus *bus);
 void pci_name_device(struct pci_dev *dev);
 char *pci_class_name(u32 class);


  reply	other threads:[~2004-11-01  0:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-22 22:00 Is there a user space pci rescan method? Dave Aubin
2004-09-22 23:58 ` Jan Dittmer
2004-09-23  0:26   ` Greg KH
2004-09-23 15:04     ` Jan Dittmer
2004-09-23 16:49       ` Rolf Eike Beer
2004-09-23 16:53         ` Jan Dittmer
2004-09-23 17:05           ` Rolf Eike Beer
2004-09-24 10:41             ` Rolf Eike Beer
2004-09-24 11:42               ` Jan Dittmer
2004-09-24 12:12                 ` Rolf Eike Beer
2004-09-24 12:16                   ` Jan Dittmer
2004-09-24 12:32                     ` Rolf Eike Beer
2004-09-24 14:55                       ` Greg KH
2004-09-27  9:14                         ` Rolf Eike Beer
2004-10-10  0:13                         ` Jan Dittmer
2004-10-10  0:59                           ` Jan Dittmer
2004-10-10 13:45                             ` Jan Dittmer
2004-10-30  4:16                               ` Greg KH
2004-10-31 23:59                                 ` Jan Dittmer [this message]
2004-11-01  9:35                                   ` [patch 1/2] fakephp: introduce pci_bus_add_device Christoph Hellwig
2004-11-02 22:51                                     ` Jan Dittmer
2004-11-11 23:47                                       ` Greg KH
2004-11-12  0:13                                         ` Jan Dittmer
2004-11-12 18:59                                           ` Greg KH
2004-10-31 23:59                                 ` [patch 2/2] fakephp: add pci bus rescan ability Jan Dittmer
2004-11-12 18:59                                   ` Greg KH
2004-09-24 13:09                     ` [Pcihpd-discuss] Re: Is there a user space pci rescan method? Matthew Wilcox
2004-09-24 13:18                       ` Rolf Eike Beer
2004-09-24 12:40               ` Jan Dittmer
2004-09-24 12:59                 ` Rolf Eike Beer
2004-09-23 23:31       ` Greg KH

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=41857C7A.2030007@ppp0.net \
    --to=jdittmer@ppp0.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pcihpd-discuss@lists.sourceforge.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.