]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: create function symlinks in /sys/bus/pci/slots/N/
authorAlex Chiang <achiang@hp.com>
Mon, 8 Mar 2010 17:24:29 +0000 (10:24 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 11 May 2010 19:01:07 +0000 (12:01 -0700)
commita86b8854625cec36f57e797ab359cf94aa904d34
treebdbd169b2220e067bc03f7445e2471aa2f8499a7
parentf1c6c088b90e6f2e5fc66f3178b58b044757f95e
PCI: create function symlinks in /sys/bus/pci/slots/N/

Create convenience symlinks in sysfs, linking slots to device
functions, and vice versa. These links make it easier for users to
figure out which devices actually live in what slots.

For example:

sapphire:/sys/bus/pci/slots # ls
1  10  2  3  4  5  6  7  8  9

sapphire:/sys/bus/pci/slots # ls -l 3
total 0
-r--r--r-- 1 root root 65536 Aug 18 14:10 address
lrwxrwxrwx 1 root root     0 Aug 18 14:10 function0 ->
../../../../devices/pci0000:23/0000:23:01.0
lrwxrwxrwx 1 root root     0 Aug 18 14:10 function1 ->
../../../../devices/pci0000:23/0000:23:01.1

sapphire:/sys/bus/pci/slots # ls -l 3/function0/slot
lrwxrwxrwx 1 root root 0 Aug 18 14:13 3/function0/slot ->
../../../bus/pci/slots/3

The original form of this patch was written by Matthew Wilcox,
and was enhanced to include links from the sysfs slots/ directory
pointing back at the device functions.

Cc: willy@linux.intel.com
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Documentation/ABI/testing/sysfs-bus-pci
drivers/pci/pci-sysfs.c
drivers/pci/slot.c