提交 4c45d245 编写于 作者: W Wang Hai 提交者: Yang Yingliang

tulip: windbond-840: Fix missing pci_disable_device() in probe and remove

stable inclusion
from linux-4.19.201
commit fdb90238e5f54868e9c4a176d2b11e6f2105d23c

--------------------------------

[ Upstream commit 76a16be0 ]

Replace pci_enable_device() with pcim_enable_device(),
pci_disable_device() and pci_release_regions() will be
called in release automatically.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NWang Hai <wanghai38@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 07865d75
...@@ -367,7 +367,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -367,7 +367,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
void __iomem *ioaddr; void __iomem *ioaddr;
i = pci_enable_device(pdev); i = pcim_enable_device(pdev);
if (i) return i; if (i) return i;
pci_set_master(pdev); pci_set_master(pdev);
...@@ -389,7 +389,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -389,7 +389,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
ioaddr = pci_iomap(pdev, TULIP_BAR, netdev_res_size); ioaddr = pci_iomap(pdev, TULIP_BAR, netdev_res_size);
if (!ioaddr) if (!ioaddr)
goto err_out_free_res; goto err_out_netdev;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i)); ((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i));
...@@ -468,8 +468,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -468,8 +468,6 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent)
err_out_cleardev: err_out_cleardev:
pci_iounmap(pdev, ioaddr); pci_iounmap(pdev, ioaddr);
err_out_free_res:
pci_release_regions(pdev);
err_out_netdev: err_out_netdev:
free_netdev (dev); free_netdev (dev);
return -ENODEV; return -ENODEV;
...@@ -1535,7 +1533,6 @@ static void w840_remove1(struct pci_dev *pdev) ...@@ -1535,7 +1533,6 @@ static void w840_remove1(struct pci_dev *pdev)
if (dev) { if (dev) {
struct netdev_private *np = netdev_priv(dev); struct netdev_private *np = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
pci_release_regions(pdev);
pci_iounmap(pdev, np->base_addr); pci_iounmap(pdev, np->base_addr);
free_netdev(dev); free_netdev(dev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册