[PATCH]: Suppress PCI bridge sysfs error messages.

From: Linas Vepstas
Date: Mon Apr 02 2007 - 16:09:42 EST




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@xxxxxxxxxxxxxx>

----

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");
+ }
}
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/