max = PCI_BRIDGE_RESOURCES;
for (i = 0; i < max; i++) {
- struct resource *res = &pci_dev->resource[i];
+ struct resource *res = pci_resource_n(pci_dev, i);
struct resource zerores = {};
/* For backwards compatibility */
return sysfs_emit(buf, "%u\n", (pdev == vga_dev));
return sysfs_emit(buf, "%u\n",
- !!(pdev->resource[PCI_ROM_RESOURCE].flags &
+ !!(pci_resource_flags(pdev, PCI_ROM_RESOURCE) &
IORESOURCE_ROM_SHADOW));
}
static DEVICE_ATTR_RO(boot_vga);
struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
int bar = (unsigned long)attr->private;
enum pci_mmap_state mmap_type;
- struct resource *res = &pdev->resource[bar];
+ struct resource *res = pci_resource_n(pdev, bar);
int ret;
ret = security_locked_down(LOCKDOWN_PCI_ACCESS);
retval = pci_create_attr(pdev, i, 0);
/* for prefetchable resources, create a WC mappable file */
if (!retval && arch_can_pci_mmap_wc() &&
- pdev->resource[i].flags & IORESOURCE_PREFETCH)
+ pci_resource_flags(pdev, i) & IORESOURCE_PREFETCH)
retval = pci_create_attr(pdev, i, 1);
if (retval) {
pci_remove_resource_files(pdev);