]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: enetc: Use pci_release_region() to release some resources
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 27 May 2022 09:25:47 +0000 (11:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 28 May 2022 19:20:42 +0000 (20:20 +0100)
Some resources are allocated using pci_request_region().
It is more straightforward to release them with pci_release_region().

Fixes: 436351e93c36 ("enetc: Add mdio bus driver for the PCIe MDIO endpoint")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c

index 15f37c5b8dc14360810c1e6e3da3a8c17d9ecc02..dafb26f81f95f38797574fcd59fe2fe5662cf6ac 100644 (file)
@@ -69,7 +69,7 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
        return 0;
 
 err_mdiobus_reg:
-       pci_release_mem_regions(pdev);
+       pci_release_region(pdev, 0);
 err_pci_mem_reg:
        pci_disable_device(pdev);
 err_pci_enable:
@@ -88,7 +88,7 @@ static void enetc_pci_mdio_remove(struct pci_dev *pdev)
        mdiobus_unregister(bus);
        mdio_priv = bus->priv;
        iounmap(mdio_priv->hw->port);
-       pci_release_mem_regions(pdev);
+       pci_release_region(pdev, 0);
        pci_disable_device(pdev);
 }