mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Dittmer <jdittmer@ppp0.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org,
	Hotplug List <pcihpd-discuss@lists.sourceforge.net>
Subject: Re: [patch 1/2] fakephp: introduce pci_bus_add_device
Date: Tue, 02 Nov 2004 23:51:15 +0100	[thread overview]
Message-ID: <41880F63.9030606@ppp0.net> (raw)
In-Reply-To: <20041101093514.GA25921@infradead.org>

Christoph Hellwig wrote:
> On Mon, Nov 01, 2004 at 12:59:54AM +0100, Jan Dittmer wrote:
> 
>>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>

> the brace should go to a line of it's own

Sorry about that, updated patch follows:

--- 1.9/drivers/pci/bus.c       2004-04-11 00:27:59 +02:00
+++ edited/drivers/pci/bus.c    2004-11-01 10:41:27 +01:00
@@ -69,6 +69,25 @@
 }

 /**
+ * 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
+ */
+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 +110,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 +146,6 @@
 }

 EXPORT_SYMBOL(pci_bus_alloc_resource);
+EXPORT_SYMBOL(pci_bus_add_device);
 EXPORT_SYMBOL(pci_bus_add_devices);
 EXPORT_SYMBOL(pci_enable_bridges);
--- 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-02 22:56 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                                 ` [patch 1/2] fakephp: introduce pci_bus_add_device Jan Dittmer
2004-11-01  9:35                                   ` Christoph Hellwig
2004-11-02 22:51                                     ` Jan Dittmer [this message]
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=41880F63.9030606@ppp0.net \
    --to=jdittmer@ppp0.net \
    --cc=greg@kroah.com \
    --cc=hch@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome