Skip to content

Commit bd23e83

Browse files
bus: mhi: host: pci_generic: Use pcim_iomap_region() to request and map MHI BAR
Use of both pcim_iomap_regions() and pcim_iomap_table() APIs are deprecated. Hence, switch to pcim_iomap_region() API which handles both the request and map of the MHI BAR region. Cc: Loic Poulain <[email protected]> Reviewed-by: Mayank Rana <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent 23388a1 commit bd23e83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/bus/mhi/host/pci_generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,12 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
917917
return err;
918918
}
919919

920-
err = pcim_iomap_regions(pdev, 1 << bar_num, pci_name(pdev));
921-
if (err) {
920+
mhi_cntrl->regs = pcim_iomap_region(pdev, 1 << bar_num, pci_name(pdev));
921+
if (IS_ERR(mhi_cntrl->regs)) {
922+
err = PTR_ERR(mhi_cntrl->regs);
922923
dev_err(&pdev->dev, "failed to map pci region: %d\n", err);
923924
return err;
924925
}
925-
mhi_cntrl->regs = pcim_iomap_table(pdev)[bar_num];
926926
mhi_cntrl->reg_len = pci_resource_len(pdev, bar_num);
927927

928928
err = dma_set_mask_and_coherent(&pdev->dev, dma_mask);

0 commit comments

Comments
 (0)