Commit fc3e07e8 authored by Cai Huoqing's avatar Cai Huoqing Committed by David S. Miller

net: hisilicon: Remove redundant pci_clear_master

Remove pci_clear_master to simplify the code,
the bus-mastering is also cleared in do_pci_disable_device,
like this:
./drivers/pci/pci.c:2197
static void do_pci_disable_device(struct pci_dev *dev)
{
	u16 pci_command;

	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
	if (pci_command & PCI_COMMAND_MASTER) {
		pci_command &= ~PCI_COMMAND_MASTER;
		pci_write_config_word(dev, PCI_COMMAND, pci_command);
	}

	pcibios_disable_device(dev);
}.
And dev->is_busmaster is set to 0 in pci_disable_device.
Signed-off-by: default avatarCai Huoqing <cai.huoqing@linux.dev>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc5aba60
...@@ -11365,7 +11365,7 @@ static int hclge_pci_init(struct hclge_dev *hdev) ...@@ -11365,7 +11365,7 @@ static int hclge_pci_init(struct hclge_dev *hdev)
if (!hw->hw.io_base) { if (!hw->hw.io_base) {
dev_err(&pdev->dev, "Can't map configuration register space\n"); dev_err(&pdev->dev, "Can't map configuration register space\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_clr_master; goto err_release_regions;
} }
ret = hclge_dev_mem_map(hdev); ret = hclge_dev_mem_map(hdev);
...@@ -11378,8 +11378,7 @@ static int hclge_pci_init(struct hclge_dev *hdev) ...@@ -11378,8 +11378,7 @@ static int hclge_pci_init(struct hclge_dev *hdev)
err_unmap_io_base: err_unmap_io_base:
pcim_iounmap(pdev, hdev->hw.hw.io_base); pcim_iounmap(pdev, hdev->hw.hw.io_base);
err_clr_master: err_release_regions:
pci_clear_master(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
err_disable_device: err_disable_device:
pci_disable_device(pdev); pci_disable_device(pdev);
...@@ -11396,7 +11395,6 @@ static void hclge_pci_uninit(struct hclge_dev *hdev) ...@@ -11396,7 +11395,6 @@ static void hclge_pci_uninit(struct hclge_dev *hdev)
pcim_iounmap(pdev, hdev->hw.hw.io_base); pcim_iounmap(pdev, hdev->hw.hw.io_base);
pci_free_irq_vectors(pdev); pci_free_irq_vectors(pdev);
pci_clear_master(pdev);
pci_release_mem_regions(pdev); pci_release_mem_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
...@@ -11743,7 +11741,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) ...@@ -11743,7 +11741,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
hclge_devlink_uninit(hdev); hclge_devlink_uninit(hdev);
err_pci_uninit: err_pci_uninit:
pcim_iounmap(pdev, hdev->hw.hw.io_base); pcim_iounmap(pdev, hdev->hw.hw.io_base);
pci_clear_master(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
out: out:
......
...@@ -2598,7 +2598,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev) ...@@ -2598,7 +2598,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev)
if (!hw->hw.io_base) { if (!hw->hw.io_base) {
dev_err(&pdev->dev, "can't map configuration register space\n"); dev_err(&pdev->dev, "can't map configuration register space\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_clr_master; goto err_release_regions;
} }
ret = hclgevf_dev_mem_map(hdev); ret = hclgevf_dev_mem_map(hdev);
...@@ -2609,8 +2609,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev) ...@@ -2609,8 +2609,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev)
err_unmap_io_base: err_unmap_io_base:
pci_iounmap(pdev, hdev->hw.hw.io_base); pci_iounmap(pdev, hdev->hw.hw.io_base);
err_clr_master: err_release_regions:
pci_clear_master(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
err_disable_device: err_disable_device:
pci_disable_device(pdev); pci_disable_device(pdev);
...@@ -2626,7 +2625,6 @@ static void hclgevf_pci_uninit(struct hclgevf_dev *hdev) ...@@ -2626,7 +2625,6 @@ static void hclgevf_pci_uninit(struct hclgevf_dev *hdev)
devm_iounmap(&pdev->dev, hdev->hw.hw.mem_base); devm_iounmap(&pdev->dev, hdev->hw.hw.mem_base);
pci_iounmap(pdev, hdev->hw.hw.io_base); pci_iounmap(pdev, hdev->hw.hw.io_base);
pci_clear_master(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment