Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rapidio/tsi721: 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.

Link: https://lkml.kernel.org/r/20230323113711.10523-1-cai.huoqing@linux.dev
Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Cai Huoqing and committed by
Andrew Morton
a74d9a3f 890a3ee3

-3
-3
drivers/rapidio/devices/tsi721.c
··· 2924 2924 iounmap(priv->odb_base); 2925 2925 err_free_res: 2926 2926 pci_release_regions(pdev); 2927 - pci_clear_master(pdev); 2928 2927 err_disable_pdev: 2929 2928 pci_disable_device(pdev); 2930 2929 err_clean: ··· 2961 2962 pci_disable_msi(priv->pdev); 2962 2963 #endif 2963 2964 pci_release_regions(pdev); 2964 - pci_clear_master(pdev); 2965 2965 pci_disable_device(pdev); 2966 2966 pci_set_drvdata(pdev, NULL); 2967 2967 kfree(priv); ··· 2975 2977 2976 2978 tsi721_disable_ints(priv); 2977 2979 tsi721_dma_stop_all(priv); 2978 - pci_clear_master(pdev); 2979 2980 pci_disable_device(pdev); 2980 2981 } 2981 2982