diff mbox series

[01/12] smartpqi: map full length of PCI BAR 0

Message ID 20230428153712.297638-2-don.brace@microchip.com
State New
Headers show
Series smartpqi updates | expand

Commit Message

Don Brace April 28, 2023, 3:37 p.m. UTC
From: Mike McGowen <mike.mcgowen@microchip.com>

Map full length of PCI BAR 0 at driver init.

During driver initialization, the driver must make a kernel call
to map the controller registers into kernel address space.
A parameter to this call is the length of the memory to be mapped.
The driver is specifying the wrong length.

Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com>
Signed-off-by: Mike McGowen <mike.mcgowen@microchip.com>
Signed-off-by: Don Brace <don.brace@microchip.com>
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 03de97cd72c2..29370757b07b 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -8560,7 +8560,7 @@  static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info)
 	ctrl_info->iomem_base = ioremap(pci_resource_start(
 		ctrl_info->pci_dev, 0),
-		sizeof(struct pqi_ctrl_registers));
+		pci_resource_len(ctrl_info->pci_dev, 0));
 	if (!ctrl_info->iomem_base) {
 			"failed to map memory for controller registers\n");