PCI/sysfs: Use correct variable for the legacy_mem sysfs object
authorKrzysztof Wilczyński <kw@linux.com>
Thu, 12 Aug 2021 13:21:44 +0000 (13:21 +0000)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:11 +0000 (08:35 -0400)
commit1d9d64cad2fe68f08a7b32ce5c3b69a9dd8a3d61
treea40e2feeb4542b865ef926bd1c7ffcba63dfb16a
parentf21adfddafdf496b2bcebbc9e0fd53591868372d
PCI/sysfs: Use correct variable for the legacy_mem sysfs object

[ Upstream commit 045a9277b5615846c7b662ffaba84e781f08a172 ]

Two legacy PCI sysfs objects "legacy_io" and "legacy_mem" were updated
to use an unified address space in the commit 636b21b50152 ("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: 636b21b50152 ("PCI: Revoke mappings like devmem")
Link: https://lore.kernel.org/r/20210812132144.791268-1-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/pci-sysfs.c