[ISDN] Hisax: eliminate many unnecessary references to CardType[]
For the vast majority of CardType[card->typ] uses (but not all!), the string is constant for each driver. Therefore, we may replace CardType[card->typ] with the actual string describing the driver, making each printk() a bit more simple. This also has the nice, intended side effect of greatly reducing external references to hisax global CardType[]. This will be of value once the ISDN drivers are converted to the ISA/PCI/PNP hotplug APIs. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Этот коммит содержится в:

коммит произвёл
Jeff Garzik

родитель
d38c8475b4
Коммит
8349304d12
@@ -21,7 +21,6 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/isapnp.h>
|
||||
|
||||
extern const char *CardType[];
|
||||
static const char *niccy_revision = "$Revision: 1.21.2.4 $";
|
||||
|
||||
#define byteout(addr,val) outb(val,addr)
|
||||
@@ -284,14 +283,14 @@ int __devinit setup_niccy(struct IsdnCard *card)
|
||||
cs->subtyp = NICCY_PNP;
|
||||
cs->irq = card->para[0];
|
||||
if (!request_region(cs->hw.niccy.isac, 2, "niccy data")) {
|
||||
printk(KERN_WARNING "HiSax: %s data port %x-%x "
|
||||
"already in use\n", CardType[card->typ],
|
||||
printk(KERN_WARNING "HiSax: NICCY data port %x-%x "
|
||||
"already in use\n",
|
||||
cs->hw.niccy.isac, cs->hw.niccy.isac + 1);
|
||||
return 0;
|
||||
}
|
||||
if (!request_region(cs->hw.niccy.isac_ale, 2, "niccy addr")) {
|
||||
printk(KERN_WARNING "HiSax: %s address port %x-%x "
|
||||
"already in use\n", CardType[card->typ],
|
||||
printk(KERN_WARNING "HiSax: NICCY address port %x-%x "
|
||||
"already in use\n",
|
||||
cs->hw.niccy.isac_ale,
|
||||
cs->hw.niccy.isac_ale + 1);
|
||||
release_region(cs->hw.niccy.isac, 2);
|
||||
@@ -339,15 +338,13 @@ int __devinit setup_niccy(struct IsdnCard *card)
|
||||
cs->hw.niccy.hscx_ale = pci_ioaddr + HSCX_PCI_ADDR;
|
||||
if (!request_region(cs->hw.niccy.isac, 4, "niccy")) {
|
||||
printk(KERN_WARNING
|
||||
"HiSax: %s data port %x-%x already in use\n",
|
||||
CardType[card->typ],
|
||||
"HiSax: NICCY data port %x-%x already in use\n",
|
||||
cs->hw.niccy.isac, cs->hw.niccy.isac + 4);
|
||||
return 0;
|
||||
}
|
||||
if (!request_region(cs->hw.niccy.cfg_reg, 0x40, "niccy pci")) {
|
||||
printk(KERN_WARNING
|
||||
"HiSax: %s pci port %x-%x already in use\n",
|
||||
CardType[card->typ],
|
||||
"HiSax: NICCY pci port %x-%x already in use\n",
|
||||
cs->hw.niccy.cfg_reg,
|
||||
cs->hw.niccy.cfg_reg + 0x40);
|
||||
release_region(cs->hw.niccy.isac, 4);
|
||||
@@ -359,8 +356,8 @@ int __devinit setup_niccy(struct IsdnCard *card)
|
||||
return 0;
|
||||
#endif /* CONFIG_PCI_LEGACY */
|
||||
}
|
||||
printk(KERN_INFO "HiSax: %s %s config irq:%d data:0x%X ale:0x%X\n",
|
||||
CardType[cs->typ], (cs->subtyp == 1) ? "PnP" : "PCI",
|
||||
printk(KERN_INFO "HiSax: NICCY %s config irq:%d data:0x%X ale:0x%X\n",
|
||||
(cs->subtyp == 1) ? "PnP" : "PCI",
|
||||
cs->irq, cs->hw.niccy.isac, cs->hw.niccy.isac_ale);
|
||||
setup_isac(cs);
|
||||
cs->readisac = &ReadISAC;
|
||||
|
Ссылка в новой задаче
Block a user