Commit 18e89691 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Convert remaining ioremap() to request_mmio()

These users didn't bother doing request_mem_region() at all before
ioremapping, which is now automatically done using request_mmio()
instead.
parent 91cc110f
...@@ -174,15 +174,6 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -174,15 +174,6 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs)
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
void
release_io_bkm(struct IsdnCardState *cs)
{
if (cs->hw.ax.base) {
iounmap((void *) cs->hw.ax.base);
cs->hw.ax.base = 0;
}
}
static void static void
enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable) enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable)
{ {
...@@ -257,9 +248,8 @@ bkm_a4t_reset(struct IsdnCardState *cs) ...@@ -257,9 +248,8 @@ bkm_a4t_reset(struct IsdnCardState *cs)
static void static void
bkm_a4t_release(struct IsdnCardState *cs) bkm_a4t_release(struct IsdnCardState *cs)
{ {
enable_bkm_int(cs, 0);
reset_bkm(cs); reset_bkm(cs);
release_io_bkm(cs); hisax_release_resources(cs);
} }
static struct card_ops bkm_a4t_ops = { static struct card_ops bkm_a4t_ops = {
...@@ -317,18 +307,18 @@ setup_bkm_a4t(struct IsdnCard *card) ...@@ -317,18 +307,18 @@ setup_bkm_a4t(struct IsdnCard *card)
printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]); printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]);
return (0); return (0);
} }
if (!pci_memaddr) { cs->hw.ax.base = request_mmio(&cs->rs,pci_memaddr, 4096, "Telekom A4T");
if (!cs->hw.ax.base) {
printk(KERN_WARNING "HiSax: %s: No Memory base address\n", CardType[card->typ]); printk(KERN_WARNING "HiSax: %s: No Memory base address\n", CardType[card->typ]);
return (0); return (0);
} }
cs->hw.ax.base = (long) ioremap(pci_memaddr, 4096);
/* Check suspecious address */ /* Check suspecious address */
pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base); pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
if ((pI20_Regs->i20IntStatus & 0x8EFFFFFF) != 0) { if ((pI20_Regs->i20IntStatus & 0x8EFFFFFF) != 0) {
printk(KERN_WARNING "HiSax: %s address %lx-%lx suspecious\n", printk(KERN_WARNING "HiSax: %s address %lx-%lx suspecious\n",
CardType[card->typ], cs->hw.ax.base, cs->hw.ax.base + 4096); CardType[card->typ], cs->hw.ax.base, cs->hw.ax.base + 4096);
iounmap((void *) cs->hw.ax.base); hisax_release_resources(cs);
cs->hw.ax.base = 0;
return (0); return (0);
} }
cs->hw.ax.isac_adr = cs->hw.ax.base + PO_OFFSET; cs->hw.ax.isac_adr = cs->hw.ax.base + PO_OFFSET;
......
...@@ -374,8 +374,7 @@ diva_ipac_pci_release(struct IsdnCardState *cs) ...@@ -374,8 +374,7 @@ diva_ipac_pci_release(struct IsdnCardState *cs)
{ {
writel(0, cs->hw.diva.pci_cfg); /* disable INT0/1 */ writel(0, cs->hw.diva.pci_cfg); /* disable INT0/1 */
writel(2, cs->hw.diva.pci_cfg); /* reset pending INT0 */ writel(2, cs->hw.diva.pci_cfg); /* reset pending INT0 */
iounmap((void *)cs->hw.diva.cfg_reg); hisax_release_resources(cs);
iounmap((void *)cs->hw.diva.pci_cfg);
} }
static int static int
...@@ -726,10 +725,8 @@ setup_diva(struct IsdnCard *card) ...@@ -726,10 +725,8 @@ setup_diva(struct IsdnCard *card)
return(0); return(0);
cs->subtyp = DIVA_IPAC_PCI; cs->subtyp = DIVA_IPAC_PCI;
cs->irq = dev_diva201->irq; cs->irq = dev_diva201->irq;
cs->hw.diva.pci_cfg = cs->hw.diva.pci_cfg = (unsigned long)request_mmio(&cs->rs, pci_resource_start(dev_diva201, 0), 4096, "diva");
(ulong) ioremap(pci_resource_start(dev_diva201, 0), 4096); cs->hw.diva.cfg_reg = (unsigned long)request_mmio(&cs->rs, pci_resource_start(dev_diva201, 1), 4096, "diva");
cs->hw.diva.cfg_reg =
(ulong) ioremap(pci_resource_start(dev_diva201, 1), 4096);
} else { } else {
printk(KERN_WARNING "Diva: No PCI card found\n"); printk(KERN_WARNING "Diva: No PCI card found\n");
return(0); return(0);
...@@ -737,12 +734,12 @@ setup_diva(struct IsdnCard *card) ...@@ -737,12 +734,12 @@ setup_diva(struct IsdnCard *card)
if (!cs->irq) { if (!cs->irq) {
printk(KERN_WARNING "Diva: No IRQ for PCI card found\n"); printk(KERN_WARNING "Diva: No IRQ for PCI card found\n");
return(0); goto err;
} }
if (!cs->hw.diva.cfg_reg) { if (!cs->hw.diva.cfg_reg) {
printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n"); printk(KERN_WARNING "Diva: No IO-Adr for PCI card found\n");
return(0); goto err;
} }
cs->irq_flags |= SA_SHIRQ; cs->irq_flags |= SA_SHIRQ;
#else #else
...@@ -821,9 +818,12 @@ setup_diva(struct IsdnCard *card) ...@@ -821,9 +818,12 @@ setup_diva(struct IsdnCard *card)
if (HscxVersion(cs, "Diva:")) { if (HscxVersion(cs, "Diva:")) {
printk(KERN_WARNING printk(KERN_WARNING
"Diva: wrong HSCX versions check IO address\n"); "Diva: wrong HSCX versions check IO address\n");
diva_release(cs); goto err;
return (0);
} }
} }
return (1); return 1;
err:
diva_release(cs);
return 0;
} }
...@@ -83,8 +83,8 @@ hfcpci_release(struct IsdnCardState *cs) ...@@ -83,8 +83,8 @@ hfcpci_release(struct IsdnCardState *cs)
Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */ Write_hfc(cs, HFCPCI_CIRM, 0); /* Reset Off */
pci_disable_device(cs->hw.hfcpci.pdev); pci_disable_device(cs->hw.hfcpci.pdev);
del_timer(&cs->hw.hfcpci.timer); del_timer(&cs->hw.hfcpci.timer);
iounmap(cs->hw.hfcpci.pci_io);
pci_free_consistent(cs->hw.hfcpci.pdev, 32768, cs->hw.hfcpci.fifos, cs->hw.hfcpci.fifos_dma); pci_free_consistent(cs->hw.hfcpci.pdev, 32768, cs->hw.hfcpci.fifos, cs->hw.hfcpci.fifos_dma);
hisax_release_resources(cs);
} }
/********************************************************************************/ /********************************************************************************/
...@@ -1441,16 +1441,11 @@ setup_hfcpci(struct IsdnCard *card) ...@@ -1441,16 +1441,11 @@ setup_hfcpci(struct IsdnCard *card)
printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n"); printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
return (0); return (0);
} }
cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name); printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
} else { } else {
printk(KERN_WARNING "HFC-PCI: No PCI card found\n"); printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
return (0); return (0);
} }
if (!cs->hw.hfcpci.pci_io) {
printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
return (0);
}
/* Allocate memory for FIFOS */ /* Allocate memory for FIFOS */
cs->hw.hfcpci.fifos = pci_alloc_consistent(tmp_hfcpci, 32768, &cs->hw.hfcpci.fifos_dma); cs->hw.hfcpci.fifos = pci_alloc_consistent(tmp_hfcpci, 32768, &cs->hw.hfcpci.fifos_dma);
if (!cs->hw.hfcpci.fifos) { if (!cs->hw.hfcpci.fifos) {
...@@ -1459,7 +1454,10 @@ setup_hfcpci(struct IsdnCard *card) ...@@ -1459,7 +1454,10 @@ setup_hfcpci(struct IsdnCard *card)
} }
pci_write_config_dword(cs->hw.hfcpci.pdev, 0x80, pci_write_config_dword(cs->hw.hfcpci.pdev, 0x80,
(u_int)cs->hw.hfcpci.fifos_dma); (u_int)cs->hw.hfcpci.fifos_dma);
cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256); cs->hw.hfcpci.pci_io = request_mmio(&cs->rs, dev_hfcpci->resource[ 1].start, 256, "hfc_pci");
if (!cs->hw.hfcpci.pci_io)
goto err;
printk(KERN_INFO printk(KERN_INFO
"HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ %d\n", "HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ %d\n",
(u_int) cs->hw.hfcpci.pci_io, (u_int) cs->hw.hfcpci.pci_io,
...@@ -1487,7 +1485,10 @@ setup_hfcpci(struct IsdnCard *card) ...@@ -1487,7 +1485,10 @@ setup_hfcpci(struct IsdnCard *card)
cs->cardmsg = &hfcpci_card_msg; cs->cardmsg = &hfcpci_card_msg;
cs->auxcmd = &hfcpci_auxcmd; cs->auxcmd = &hfcpci_auxcmd;
cs->card_ops = &hfcpci_ops; cs->card_ops = &hfcpci_ops;
return (1); return 1;
err:
hisax_release_resources(cs);
return 0;
#else #else
printk(KERN_WARNING "HFC-PCI: NO_PCI_BIOS\n"); printk(KERN_WARNING "HFC-PCI: NO_PCI_BIOS\n");
return (0); return (0);
......
...@@ -225,12 +225,6 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -225,12 +225,6 @@ telespci_interrupt(int intno, void *dev_id, struct pt_regs *regs)
spin_unlock(&cs->lock); spin_unlock(&cs->lock);
} }
void
telespci_release(struct IsdnCardState *cs)
{
iounmap((void *)cs->hw.teles0.membase);
}
static int static int
TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg) TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{ {
...@@ -239,7 +233,7 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -239,7 +233,7 @@ TelesPCI_card_msg(struct IsdnCardState *cs, int mt, void *arg)
static struct card_ops telespci_ops = { static struct card_ops telespci_ops = {
.init = inithscxisac, .init = inithscxisac,
.release = telespci_release, .release = hisax_release_resources,
.irq_func = telespci_interrupt, .irq_func = telespci_interrupt,
}; };
...@@ -271,8 +265,9 @@ setup_telespci(struct IsdnCard *card) ...@@ -271,8 +265,9 @@ setup_telespci(struct IsdnCard *card)
printk(KERN_WARNING "Teles: No IRQ for PCI card found\n"); printk(KERN_WARNING "Teles: No IRQ for PCI card found\n");
return(0); return(0);
} }
cs->hw.teles0.membase = ioremap(pci_resource_start(dev_tel, 0), cs->hw.teles0.membase = request_mmio(&cs->rs, pci_resource_start(dev_tel, 0), 4096, "telespci");
PAGE_SIZE); if (!cs->hw.teles0.membase)
goto err;
printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n", printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
pci_resource_start(dev_tel, 0), dev_tel->irq); pci_resource_start(dev_tel, 0), dev_tel->irq);
} else { } else {
...@@ -308,8 +303,10 @@ setup_telespci(struct IsdnCard *card) ...@@ -308,8 +303,10 @@ setup_telespci(struct IsdnCard *card)
if (HscxVersion(cs, "TelesPCI:")) { if (HscxVersion(cs, "TelesPCI:")) {
printk(KERN_WARNING printk(KERN_WARNING
"TelesPCI: wrong HSCX versions check IO/MEM addresses\n"); "TelesPCI: wrong HSCX versions check IO/MEM addresses\n");
telespci_release(cs); goto err;
return (0);
} }
return (1); return 1;
err:
hisax_release_resources(cs);
return 0;
} }
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