Commit f39b0e05 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] niccy region handling cleanups

parent 4fdb04b7
...@@ -258,16 +258,15 @@ setup_niccy(struct IsdnCard *card) ...@@ -258,16 +258,15 @@ setup_niccy(struct IsdnCard *card)
cs->hw.niccy.cfg_reg = 0; cs->hw.niccy.cfg_reg = 0;
cs->subtyp = NICCY_PNP; cs->subtyp = NICCY_PNP;
cs->irq = card->para[0]; cs->irq = card->para[0];
if (check_region((cs->hw.niccy.isac), 2)) { if (!request_region(cs->hw.niccy.isac, 2, "niccy data")) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s data port %x-%x already in use\n", "HiSax: %s data port %x-%x already in use\n",
CardType[card->typ], CardType[card->typ],
cs->hw.niccy.isac, cs->hw.niccy.isac,
cs->hw.niccy.isac + 1); cs->hw.niccy.isac + 1);
return (0); return (0);
} else }
request_region(cs->hw.niccy.isac, 2, "niccy data"); if (!request_region(cs->hw.niccy.isac_ale, 2, "niccy addr")) {
if (check_region((cs->hw.niccy.isac_ale), 2)) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s address port %x-%x already in use\n", "HiSax: %s address port %x-%x already in use\n",
CardType[card->typ], CardType[card->typ],
...@@ -275,8 +274,7 @@ setup_niccy(struct IsdnCard *card) ...@@ -275,8 +274,7 @@ setup_niccy(struct IsdnCard *card)
cs->hw.niccy.isac_ale + 1); cs->hw.niccy.isac_ale + 1);
release_region(cs->hw.niccy.isac, 2); release_region(cs->hw.niccy.isac, 2);
return (0); return (0);
} else }
request_region(cs->hw.niccy.isac_ale, 2, "niccy addr");
} else { } else {
#if CONFIG_PCI #if CONFIG_PCI
u_int pci_ioaddr; u_int pci_ioaddr;
...@@ -315,16 +313,15 @@ setup_niccy(struct IsdnCard *card) ...@@ -315,16 +313,15 @@ setup_niccy(struct IsdnCard *card)
cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR; cs->hw.niccy.isac_ale = pci_ioaddr + ISAC_PCI_ADDR;
cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA; cs->hw.niccy.hscx = pci_ioaddr + HSCX_PCI_DATA;
cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR; cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR;
if (check_region((cs->hw.niccy.isac), 4)) { if (!request_region(cs->hw.niccy.isac, 4, "niccy")) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s data port %x-%x already in use\n", "HiSax: %s data port %x-%x already in use\n",
CardType[card->typ], CardType[card->typ],
cs->hw.niccy.isac, cs->hw.niccy.isac,
cs->hw.niccy.isac + 4); cs->hw.niccy.isac + 4);
return (0); return (0);
} else }
request_region(cs->hw.niccy.isac, 4, "niccy"); if (!request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci")) {
if (check_region(cs->hw.niccy.cfg_reg, 0x40)) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s pci port %x-%x already in use\n", "HiSax: %s pci port %x-%x already in use\n",
CardType[card->typ], CardType[card->typ],
...@@ -332,8 +329,6 @@ setup_niccy(struct IsdnCard *card) ...@@ -332,8 +329,6 @@ setup_niccy(struct IsdnCard *card)
cs->hw.niccy.cfg_reg + 0x40); cs->hw.niccy.cfg_reg + 0x40);
release_region(cs->hw.niccy.isac, 4); release_region(cs->hw.niccy.isac, 4);
return (0); return (0);
} else {
request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci");
} }
#else #else
printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n"); printk(KERN_WARNING "Niccy: io0 0 and NO_PCI_BIOS\n");
......
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