From 4cafd03a916e2f7c15520fed0b7894cf25f4ecc5 Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Fri, 3 Aug 2018 10:27:07 +0200 Subject: [PATCH] staging: mt7621-pci: remove remaining pci_legacy dependant code pcibios_* remaining code is not neccessary at all. We can use map_irq set to of_irq_parse_and_map_pci driver 'probe' function. Remove this code. Signed-off-by: Sergio Paracuellos Tested-by: NeilBrown Signed-off-by: Greg Kroah-Hartman --- drivers/staging/mt7621-pci/pci-mt7621.c | 33 +------------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c index dd1a72890caf..a49e2795af6b 100644 --- a/drivers/staging/mt7621-pci/pci-mt7621.c +++ b/drivers/staging/mt7621-pci/pci-mt7621.c @@ -214,32 +214,6 @@ write_config(struct mt7621_pcie *pcie, unsigned int dev, u32 reg, u32 val) pcie_write(pcie, val, RALINK_PCI_CONFIG_DATA); } -int -pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) -{ - struct mt7621_pcie *pcie = dev->bus->sysdata; - u16 cmd; - u32 val; - int irq; - - if (dev->bus->number == 0) { - write_config(pcie, slot, PCI_BASE_ADDRESS_0, MEMORY_BASE); - val = read_config(pcie, slot, PCI_BASE_ADDRESS_0); - printk("BAR0 at slot %d = %x\n", slot, val); - } - - pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x14); //configure cache line size 0x14 - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xFF); //configure latency timer 0x10 - pci_read_config_word(dev, PCI_COMMAND, &cmd); - cmd = cmd | PCI_COMMAND_MASTER | PCI_COMMAND_IO | PCI_COMMAND_MEMORY; - pci_write_config_word(dev, PCI_COMMAND, cmd); - - irq = of_irq_parse_and_map_pci(dev, slot, pin); - - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); - return irq; -} - void set_pcie_phy(struct mt7621_pcie *pcie, u32 offset, int start_b, int bits, int val) @@ -461,7 +435,7 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host, host->busnr = pcie->busn.start; host->dev.parent = pcie->dev; host->ops = &mt7621_pci_ops; - host->map_irq = pcibios_map_irq; + host->map_irq = of_irq_parse_and_map_pci; host->swizzle_irq = pci_common_swizzle; host->sysdata = pcie; @@ -726,11 +700,6 @@ pcie(2/1/0) link status pcie2_num pcie1_num pcie0_num return 0; } -int pcibios_plat_dev_init(struct pci_dev *dev) -{ - return 0; -} - static const struct of_device_id mt7621_pci_ids[] = { { .compatible = "mediatek,mt7621-pci" }, {}, -- 2.20.1