Commit 8c9ad508 authored by Sergey Vlasov's avatar Sergey Vlasov Committed by Greg Kroah-Hartman

[PATCH] PCIE: make bus_id for PCI Express devices unique

The bus_id string must be unique for all devices of that bus in the
system, not just for devices with the same parent - otherwise multiple
symlinks with identical names appear in /sys/bus/pci_express/devices.
Signed-off-by: default avatarSergey Vlasov <vsu@altlinux.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb37fb96
......@@ -238,8 +238,8 @@ static void pcie_device_init(struct pci_dev *parent, struct pcie_device *dev,
device->driver = NULL;
device->driver_data = NULL;
device->release = release_pcie_device; /* callback to free pcie dev */
sprintf(&device->bus_id[0], "pcie%02x",
get_descriptor_id(port_type, service_type));
snprintf(device->bus_id, sizeof(device->bus_id), "%s:pcie%02x",
pci_name(parent), get_descriptor_id(port_type, service_type));
device->parent = &parent->dev;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment