|
@@ -47,8 +47,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
|
|
|
bus = pdev->subordinate;
|
|
|
|
|
|
out += sprintf(buf, "Free resources: memory\n");
|
|
|
- for (index = 0; index < PCI_BUS_NUM_RESOURCES; index++) {
|
|
|
- res = bus->resource[index];
|
|
|
+ pci_bus_for_each_resource(bus, res, index) {
|
|
|
if (res && (res->flags & IORESOURCE_MEM) &&
|
|
|
!(res->flags & IORESOURCE_PREFETCH)) {
|
|
|
out += sprintf(out, "start = %8.8llx, "
|
|
@@ -58,8 +57,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
|
|
|
}
|
|
|
}
|
|
|
out += sprintf(out, "Free resources: prefetchable memory\n");
|
|
|
- for (index = 0; index < PCI_BUS_NUM_RESOURCES; index++) {
|
|
|
- res = bus->resource[index];
|
|
|
+ pci_bus_for_each_resource(bus, res, index) {
|
|
|
if (res && (res->flags & IORESOURCE_MEM) &&
|
|
|
(res->flags & IORESOURCE_PREFETCH)) {
|
|
|
out += sprintf(out, "start = %8.8llx, "
|
|
@@ -69,8 +67,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
|
|
|
}
|
|
|
}
|
|
|
out += sprintf(out, "Free resources: IO\n");
|
|
|
- for (index = 0; index < PCI_BUS_NUM_RESOURCES; index++) {
|
|
|
- res = bus->resource[index];
|
|
|
+ pci_bus_for_each_resource(bus, res, index) {
|
|
|
if (res && (res->flags & IORESOURCE_IO)) {
|
|
|
out += sprintf(out, "start = %8.8llx, "
|
|
|
"length = %8.8llx\n",
|