mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Subject: [PATCH]: Suppress PCI bridge sysfs error messages.
Date: Mon, 2 Apr 2007 15:09:24 -0500	[thread overview]
Message-ID: <20070402200923.GG4922@austin.ibm.com> (raw)



Greg, 

A non-urgent and somwhat ugly patch; please review, and if 
it seems correct, please apply.

--linas

While fiddling with PCI hotplugging, I noticed the messages

pci 0001:00:02.4: Error creating sysfs bridge symlink, continuing...
pci 0001:00:02.2: Error creating sysfs bridge symlink, continuing...
pci 0001:00:02.6: Error creating sysfs bridge symlink, continuing...
pci 0001:00:02.0: Error creating sysfs bridge symlink, continuing...

These are printed by pci_bus_add_devices(); the reason for the error 
is that these are all other bridges that are already in sysfs. 
For a while, I assumed that pci_bus_add_devices() was being called
with the wrong argument, but this seems not to be the case. Thus,
I simply added a flag to make these prints go quiet. 

This patch also cleans up some crazy whitespace indentation.

This patch seems inelegant, but I'm not sure what else to do.


Signed-off-by: Linas Vepstas <linas@austin.ibm.com>

----

 drivers/pci/bus.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Index: linux-2.6.21-rc4-git4/drivers/pci/bus.c
===================================================================
--- linux-2.6.21-rc4-git4.orig/drivers/pci/bus.c	2007-04-02 14:34:46.000000000 -0500
+++ linux-2.6.21-rc4-git4/drivers/pci/bus.c	2007-04-02 14:40:52.000000000 -0500
@@ -131,18 +131,22 @@ void __devinit pci_bus_add_devices(struc
 		 * it and then scan for unattached PCI devices.
 		 */
 		if (dev->subordinate) {
-		       if (list_empty(&dev->subordinate->node)) {
-			       down_write(&pci_bus_sem);
-			       list_add_tail(&dev->subordinate->node,
+			int make_link = 0;
+			if (list_empty(&dev->subordinate->node)) {
+				make_link = 1;
+				down_write(&pci_bus_sem);
+				list_add_tail(&dev->subordinate->node,
 					       &dev->bus->children);
-			       up_write(&pci_bus_sem);
+				up_write(&pci_bus_sem);
 			}
 			pci_bus_add_devices(dev->subordinate);
-			retval = sysfs_create_link(&dev->subordinate->class_dev.kobj,
+			if (make_link) {
+				retval = sysfs_create_link(&dev->subordinate->class_dev.kobj,
 						   &dev->dev.kobj, "bridge");
-			if (retval)
-				dev_err(&dev->dev, "Error creating sysfs "
-					"bridge symlink, continuing...\n");
+				if (retval)
+					dev_err(&dev->dev, "Error creating sysfs "
+						"bridge symlink, continuing...\n");
+			}
 		}
 	}
 }

                 reply	other threads:[~2007-04-02 20:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070402200923.GG4922@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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