]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
Fix /proc/bus/pci access: filenames were all wrong
authorMichael S. Tsirkin <mst@mellanox.co.il>
Tue, 17 Apr 2007 22:55:05 +0000 (01:55 +0300)
committerMichael S. Tsirkin <mst@mellanox.co.il>
Tue, 17 Apr 2007 22:55:05 +0000 (01:55 +0300)
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
mtcr.h

diff --git a/mtcr.h b/mtcr.h
index 8f7de03031539bbe4ad77088bee9151531870525..107b768a692004700515118684b3c73807fd450c 100644 (file)
--- a/mtcr.h
+++ b/mtcr.h
@@ -574,8 +574,8 @@ mfile *mopen(const char *name)
        int force;
        char rbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/resource0";
        char cbuf[] = "/sys/bus/pci/devices/XXXX:XX:XX.X/config";
-       char pdbuf[] = "/proc/bus/pci/devices/XXXX:XX/XX.X";
-       char pbuf[] = "/proc/bus/pci/devices/XX/XX.X";
+       char pdbuf[] = "/proc/bus/pci/XXXX:XX/XX.X";
+       char pbuf[] = "/proc/bus/pci/XX/XX.X";
        char errbuf[4048]="";
        int err;
 
@@ -618,16 +618,16 @@ mfile *mopen(const char *name)
        if (offset == -1)
                goto access_config;
 
-       sprintf(pdbuf, "/proc/bus/pci/devices/%4.4x:%2.2x/%2.2x.%1.1x",
+       sprintf(pdbuf, "/proc/bus/pci/%4.4x:%2.2x/%2.2x.%1.1x",
                domain, bus, dev, func);
 
        if (!mtcr_mmap(mf, pdbuf, offset, 1))
                return mf;
 
        if (!domain) {
-               sprintf(pbuf, "/proc/bus/pci/devices/%2.2x/%2.2x.%1.1x",
+               sprintf(pbuf, "/proc/bus/pci/%2.2x/%2.2x.%1.1x",
                        bus, dev, func);
-               if (!mtcr_mmap(mf, pdbuf, offset, 1))
+               if (!mtcr_mmap(mf, pbuf, offset, 1))
                        return mf;
        }