Commit 7d2012ed authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Remove superfluous card type checks

We use card->typ to decide which subdriver to call, so there's
no need at all for the subdriver to check again that card->typ is correct.
parent b362b375
......@@ -707,8 +707,6 @@ setup_amd7930(struct IsdnCard *card)
strcpy(tmp, amd7930_revision);
printk(KERN_INFO "HiSax: AMD7930 driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_AMD7930)
return 0;
cs->irq = amd7930_get_irqnum(0);
if (cs->irq == 0)
......
......@@ -262,8 +262,6 @@ setup_asuscom(struct IsdnCard *card)
strcpy(tmp, Asuscom_revision);
printk(KERN_INFO "HiSax: Asuscom ISDNLink driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_ASUSCOM)
return (0);
#ifdef __ISAPNP__
if (!card->para[1] && isapnp_present()) {
struct pci_bus *pb;
......
......@@ -169,8 +169,6 @@ setup_avm_a1(struct IsdnCard *card)
strcpy(tmp, avm_revision);
printk(KERN_INFO "HiSax: AVM driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_A1)
return (0);
cs->hw.avm.cfg_reg = request_io(&cs->rs, card->para[1] + 0x1800, 8, "avm cfg");
if (!cs->hw.avm.cfg_reg) goto err;
......
......@@ -226,9 +226,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
strcpy(tmp, avm_revision);
printk(KERN_INFO "HiSax: AVM A1 PCMCIA driver Rev. %s\n",
HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_A1_PCMCIA)
return (0);
cs->hw.avm.cfg_reg = card->para[1];
cs->irq = card->para[0];
......
......@@ -611,8 +611,6 @@ setup_avm_pcipnp(struct IsdnCard *card)
strcpy(tmp, avm_pci_rev);
printk(KERN_INFO "HiSax: AVM PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_FRITZPCI)
return (0);
if (card->para[1]) {
/* old manual method */
cs->hw.avm.cfg_reg = card->para[1];
......
......@@ -177,20 +177,17 @@ bkm_interrupt(int intno, void *dev_id, struct pt_regs *regs)
static void
enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable)
{
if (cs->typ == ISDN_CTYPE_BKM_A4T) {
I20_REGISTER_FILE *pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
if (bEnable)
pI20_Regs->i20IntCtrl |= (intISDN | intPCI);
else
/* CAUTION: This disables the video capture driver too */
pI20_Regs->i20IntCtrl &= ~(intISDN | intPCI);
}
}
static void
reset_bkm(struct IsdnCardState *cs)
{
if (cs->typ == ISDN_CTYPE_BKM_A4T) {
I20_REGISTER_FILE *pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
/* Issue the I20 soft reset */
pI20_Regs->i20SysControl = 0xFF; /* all in */
......@@ -218,7 +215,6 @@ reset_bkm(struct IsdnCardState *cs)
g_A4T_ISAR_RES);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10 * HZ) / 1000);
}
}
static void
......@@ -265,11 +261,6 @@ setup_bkm_a4t(struct IsdnCard *card)
strcpy(tmp, bkm_a4t_revision);
printk(KERN_INFO "HiSax: T-Berkom driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ == ISDN_CTYPE_BKM_A4T) {
cs->subtyp = BKM_A4T;
} else
return (0);
while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN,
PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) {
u16 sub_sys;
......
......@@ -99,12 +99,10 @@ set_ipac_active(struct IsdnCardState *cs, u_int active)
static void
enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable)
{
if (cs->typ == ISDN_CTYPE_SCT_QUADRO) {
if (bEnable)
wordout(cs->hw.ax.plx_adr + 0x4C, (wordin(cs->hw.ax.plx_adr + 0x4C) | 0x41));
else
wordout(cs->hw.ax.plx_adr + 0x4C, (wordin(cs->hw.ax.plx_adr + 0x4C) & ~0x41));
}
}
static void
......@@ -172,11 +170,6 @@ setup_sct_quadro(struct IsdnCard *card)
strcpy(tmp, sct_quadro_revision);
printk(KERN_INFO "HiSax: T-Berkom driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ == ISDN_CTYPE_SCT_QUADRO) {
cs->subtyp = SCT_1; /* Preset */
} else
return (0);
/* Identify subtype by para[0] */
if (card->para[0] >= SCT_1 && card->para[0] <= SCT_4)
cs->subtyp = card->para[0];
......
......@@ -556,8 +556,6 @@ setup_diva(struct IsdnCard *card)
strcpy(tmp, Diva_revision);
printk(KERN_INFO "HiSax: Eicon.Diehl Diva driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_DIEHLDIVA)
return(0);
if (card->para[1]) {
cs->hw.diva.ctrl_reg = 0;
cs->hw.diva.cfg_reg = card->para[1];
......
......@@ -276,8 +276,6 @@ setup_enternow_pci(struct IsdnCard *card)
#endif
strcpy(tmp, enternow_pci_rev);
printk(KERN_INFO "HiSax: Formula-n Europe AG enter:now ISDN PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_ENTERNOW)
return(0);
for ( ;; ) {
if ((dev_netjet = pci_find_device(PCI_VENDOR_ID_TIGERJET,
......
......@@ -530,9 +530,6 @@ setup_gazel(struct IsdnCard *card)
strcpy(tmp, gazel_revision);
printk(KERN_INFO "Gazel: Driver Revision %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_GAZEL)
return (0);
if (card->para[0]) {
if (setup_gazelisa(card, cs))
return (0);
......
......@@ -1398,7 +1398,7 @@ setup_hfcpci(struct IsdnCard *card)
cs->hw.hfcpci.int_s1 = 0;
cs->dc.hfcpci.ph_state = 0;
cs->hw.hfcpci.fifo = 255;
if (cs->typ == ISDN_CTYPE_HFC_PCI) {
i = 0;
while (id_list[i].vendor_id) {
tmp_hfcpci = pci_find_device(id_list[i].vendor_id,
......@@ -1455,9 +1455,6 @@ setup_hfcpci(struct IsdnCard *card)
Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2);
/* At this point the needed PCI config is done */
/* fifos are still not enabled */
} else
return (0); /* no valid card type */
cs->irq_flags |= SA_SHIRQ;
......
......@@ -1223,8 +1223,7 @@ setup_hfcsx(struct IsdnCard *card)
cs->hw.hfcsx.int_s1 = 0;
cs->dc.hfcsx.ph_state = 0;
cs->hw.hfcsx.fifo = 255;
if ((cs->typ == ISDN_CTYPE_HFC_SX) ||
(cs->typ == ISDN_CTYPE_HFC_SP_PCMCIA)) {
if (!request_io(&cs->rs, cs->hw.hfcsx.base, 2, "HFCSX isdn"))
return 0;
byteout(cs->hw.hfcsx.base, cs->hw.hfcsx.base & 0xFF);
......@@ -1246,8 +1245,7 @@ setup_hfcsx(struct IsdnCard *card)
return 0;
}
if (!ccd_sp_irqtab[cs->irq & 0xF]) {
printk(KERN_WARNING
"HFC_SX: invalid irq %d specified\n",
printk(KERN_WARNING "HFC_SX: invalid irq %d specified\n",
cs->irq & 0xF);
hisax_release_resources(cs);
return 0;
......@@ -1256,21 +1254,17 @@ setup_hfcsx(struct IsdnCard *card)
GFP_ATOMIC);
if (!cs->hw.hfcsx.extra) {
hisax_release_resources(cs);
printk(KERN_WARNING
"HFC-SX: unable to allocate memory\n");
printk(KERN_WARNING "HFC-SX: unable to allocate memory\n");
return 0;
}
printk(KERN_INFO
"HFC-S%c chip detected at base 0x%x IRQ %d HZ %d\n",
printk(KERN_INFO "HFC-S%c chip detected at base 0x%x IRQ %d HZ %d\n",
tmp[0], (u_int) cs->hw.hfcsx.base,
cs->irq, HZ);
cs->hw.hfcsx.int_m2 = 0; /* disable alle interrupts */
cs->hw.hfcsx.int_m1 = 0;
Write_hfc(cs, HFCSX_INT_M1, cs->hw.hfcsx.int_m1);
Write_hfc(cs, HFCSX_INT_M2, cs->hw.hfcsx.int_m2);
} else
return (0); /* no valid card type */
cs->hw.hfcsx.timer.function = (void *) hfcsx_Timer;
cs->hw.hfcsx.timer.data = (long) cs;
......@@ -1281,5 +1275,5 @@ setup_hfcsx(struct IsdnCard *card)
hfcsx_reset(cs);
cs->auxcmd = &hfcsx_auxcmd;
cs->card_ops = &hfcsx_ops;
return (1);
return 1;
}
......@@ -197,8 +197,6 @@ setup_isurf(struct IsdnCard *card)
strcpy(tmp, ISurf_revision);
printk(KERN_INFO "HiSax: ISurf driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_ISURF)
return(0);
if (card->para[1] && card->para[2]) {
cs->hw.isurf.reset = card->para[1];
cs->irq = card->para[0];
......
......@@ -186,8 +186,6 @@ setup_ix1micro(struct IsdnCard *card)
strcpy(tmp, ix1_revision);
printk(KERN_INFO "HiSax: ITK IX1 driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_IX1MICROR2)
return (0);
#ifdef __ISAPNP__
if (!card->para[1] && isapnp_present()) {
......
......@@ -146,8 +146,6 @@ setup_mic(struct IsdnCard *card)
strcpy(tmp, mic_revision);
printk(KERN_INFO "HiSax: mic driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_MIC)
return (0);
cs->hw.mic.cfg_reg = card->para[1];
cs->irq = card->para[0];
......
......@@ -212,8 +212,6 @@ setup_niccy(struct IsdnCard *card)
strcpy(tmp, niccy_revision);
printk(KERN_INFO "HiSax: Niccy driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_NICCY)
return (0);
#ifdef __ISAPNP__
if (!card->para[1] && isapnp_present()) {
struct pci_bus *pb;
......
......@@ -119,8 +119,6 @@ setup_netjet_s(struct IsdnCard *card)
#endif
strcpy(tmp, NETjet_S_revision);
printk(KERN_INFO "HiSax: Traverse Tech. NETjet-S driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_NETJET_S)
return(0);
for ( ;; ) {
if ((dev_netjet = pci_find_device(PCI_VENDOR_ID_TIGERJET,
......
......@@ -122,8 +122,6 @@ setup_netjet_u(struct IsdnCard *card)
#endif
strcpy(tmp, NETjet_U_revision);
printk(KERN_INFO "HiSax: Traverse Tech. NETspider-U driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_NETJET_U)
return(0);
for ( ;; ) {
if ((dev_netjet = pci_find_device(PCI_VENDOR_ID_TIGERJET,
......
......@@ -180,9 +180,6 @@ setup_s0box(struct IsdnCard *card)
strcpy(tmp, s0box_revision);
printk(KERN_INFO "HiSax: S0Box IO driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_S0BOX)
return (0);
cs->hw.teles3.cfg_reg = card->para[1];
cs->hw.teles3.hscx[0] = -0x20;
cs->hw.teles3.hscx[1] = 0x0;
......
......@@ -198,8 +198,6 @@ setup_sportster(struct IsdnCard *card)
strcpy(tmp, sportster_revision);
printk(KERN_INFO "HiSax: USR Sportster driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_SPORTSTER)
return (0);
cs->hw.spt.cfg_reg = card->para[1];
cs->irq = card->para[0];
......
......@@ -264,8 +264,6 @@ setup_TeleInt(struct IsdnCard *card)
strcpy(tmp, TeleInt_revision);
printk(KERN_INFO "HiSax: TeleInt driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_TELEINT)
return (0);
cs->hw.hfc.addr = card->para[1] & 0x3fe;
cs->irq = card->para[0];
......
......@@ -174,9 +174,6 @@ setup_teles0(struct IsdnCard *card)
strcpy(tmp, teles0_revision);
printk(KERN_INFO "HiSax: Teles 8.0/16.0 driver Rev. %s\n", HiSax_getrev(tmp));
if ((cs->typ != ISDN_CTYPE_16_0) && (cs->typ != ISDN_CTYPE_8_0))
return (0);
if (cs->typ == ISDN_CTYPE_16_0)
cs->hw.teles0.cfg_reg = card->para[2];
else /* 8.0 */
......
......@@ -244,8 +244,6 @@ setup_telespci(struct IsdnCard *card)
#endif
strcpy(tmp, telespci_revision);
printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_TELESPCI)
return (0);
if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
if (pci_enable_device(dev_tel))
return(0);
......
......@@ -682,8 +682,6 @@ setup_w6692(struct IsdnCard *card)
#endif
strcpy(tmp, w6692_revision);
printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_W6692)
return (0);
while (id_list[id_idx].vendor_id) {
dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
id_list[id_idx].device_id,
......
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