INTEL-IGB: Convert iounmap to pci_iounmap
authorPeter Senna Tschudin <peter.senna@gmail.com>
Thu, 20 Mar 2014 03:31:08 +0000 (03:31 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 31 Mar 2014 22:48:03 +0000 (15:48 -0700)
Use pci_iounmap instead of iounmap when the virtual mapping was done
with pci_iomap. A simplified version of the semantic patch that finds this
issue is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression addr;
@@
addr = pci_iomap(...)

@rr@
expression r.addr;
@@
* iounmap(addr)
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 55fc5596e2d045042a3f33251440fdc137214d13..30198185d19ae413850b0f4e11c4a4ddb8d75406 100644 (file)
@@ -2652,7 +2652,7 @@ err_eeprom:
                iounmap(hw->flash_address);
 err_sw_init:
        igb_clear_interrupt_scheme(adapter);
-       iounmap(hw->hw_addr);
+       pci_iounmap(pdev, hw->hw_addr);
 err_ioremap:
        free_netdev(netdev);
 err_alloc_etherdev:
@@ -2819,7 +2819,7 @@ static void igb_remove(struct pci_dev *pdev)
        igb_disable_sriov(pdev);
 #endif
 
-       iounmap(hw->hw_addr);
+       pci_iounmap(pdev, hw->hw_addr);
        if (hw->flash_address)
                iounmap(hw->flash_address);
        pci_release_selected_regions(pdev,