PCI: Use BAR index in sysfs attr->private instead of resource pointer
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 12 Apr 2017 12:25:57 +0000 (13:25 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 20 Apr 2017 13:47:47 +0000 (08:47 -0500)
commitdca40b186b757c7f9a05f870f69e0dfaeca59d7b
tree187dad1f59b103b44b0554d155eb5c8145d5d341
parente854d8b2a82ef76521ad2bed68211fde0511d417
PCI: Use BAR index in sysfs attr->private instead of resource pointer

We store the pointer, and then on *every* use of it we loop over the
device's resources to find out the index.  That's kind of silly.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-sysfs.c