Skip to content

Commit 045a927

Browse files
kwilczynskibjorn-helgaas
authored andcommitted
PCI/sysfs: Use correct variable for the legacy_mem sysfs object
Two legacy PCI sysfs objects "legacy_io" and "legacy_mem" were updated to use an unified address space in the commit 636b21b ("PCI: Revoke mappings like devmem"). This allows for revocations to be managed from a single place when drivers want to take over and mmap() a /dev/mem range. Following the update, both of the sysfs objects should leverage the iomem_get_mapping() function to get an appropriate address range, but only the "legacy_io" has been correctly updated - the second attribute seems to be using a wrong variable to pass the iomem_get_mapping() function to. Thus, correct the variable name used so that the "legacy_mem" sysfs object would also correctly call the iomem_get_mapping() function. Fixes: 636b21b ("PCI: Revoke mappings like devmem") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Daniel Vetter <[email protected]>
1 parent e0bff43 commit 045a927

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pci-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ void pci_create_legacy_files(struct pci_bus *b)
978978
b->legacy_mem->size = 1024*1024;
979979
b->legacy_mem->attr.mode = 0600;
980980
b->legacy_mem->mmap = pci_mmap_legacy_mem;
981-
b->legacy_io->mapping = iomem_get_mapping();
981+
b->legacy_mem->mapping = iomem_get_mapping();
982982
pci_adjust_legacy_attr(b, pci_mmap_mem);
983983
error = device_create_bin_file(&b->dev, b->legacy_mem);
984984
if (error)

0 commit comments

Comments
 (0)