lkml.org 
[lkml]   [2003]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] PCI changes and fixes for 2.5.72
From
Date
ChangeSet 1.1327.5.2, 2003/06/16 16:44:06-07:00, willy@debian.org

[PATCH] PCI: Unconfuse /proc

If we are to cope with multiple domains with clashing PCI bus numbers,
we must refrain from creating two directories of the same name in
/proc/bus/pci. This is one solution to the problem; busses with a
non-zero domain number get it prepended.

Alternative solutions include cowardly refusing to create non-domain-zero
bus directories, refusing to create directories with clashing names, and
sticking our heads in the sand and pretending the problem doesn't exist.


drivers/pci/proc.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)


diff -Nru a/drivers/pci/proc.c b/drivers/pci/proc.c
--- a/drivers/pci/proc.c Thu Jun 19 16:32:21 2003
+++ b/drivers/pci/proc.c Thu Jun 19 16:32:21 2003
@@ -383,7 +383,11 @@
return -EACCES;

if (!(de = bus->procdir)) {
- sprintf(name, "%02x", bus->number);
+ if (pci_domain_nr(bus) == 0) {
+ sprintf(name, "%02x", bus->number);
+ } else {
+ sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number);
+ }
de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
if (!de)
return -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.040 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site