Commit 76d1c81b authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Fix some of the new PnP stuff

I appreciate the adaption of the ISDN drivers to the new PnP layer
(though I don't know why it was actually necessary to break the old
ISAPnP so late in the cycle), but the gratuitious changes to the coding
style were not exactly necessary. So revert things to the
"if (retval) goto err_unwind;" style and fix a couple of other compile
time errors.
parent 3dc0cfe0
......@@ -46,6 +46,9 @@ MODULE_PARM(debug, "i");
MODULE_AUTHOR("Kai Germaschewski <kai.germaschewski@gmx.de>/Karsten Keil <kkeil@suse.de>");
MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
// FIXME temporary hack until I sort out the new PnP stuff
#define __ISAPNP__
static struct pci_device_id fcpci_ids[] __devinitdata = {
{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1 , PCI_ANY_ID, PCI_ANY_ID,
0, 0, (unsigned long) "Fritz!Card PCI" },
......@@ -55,11 +58,12 @@ static struct pci_device_id fcpci_ids[] __devinitdata = {
};
MODULE_DEVICE_TABLE(pci, fcpci_ids);
static const struct pnp_card_id fcpnp_ids[] __devinitdata = {
{ .id = "AVM0900", .driver_data = (unsigned long) "Fritz!Card PnP",
static struct pnp_card_id fcpnp_ids[] __devinitdata = {
{ .id = "AVM0900",
.driver_data = (unsigned long) "Fritz!Card PnP",
.devs = { { "AVM0900" } } }
};
MODULE_DEVICE_TABLE(pnpc, fcpnp_ids);
//MODULE_DEVICE_TABLE(pnpc, fcpnp_ids); FIXME
static int protocol = 2; /* EURO-ISDN Default */
MODULE_PARM(protocol, "i");
......@@ -911,19 +915,22 @@ static int __devinit fcpnp_probe(struct pnp_card *card,
{
struct fritz_adapter *adapter;
struct pnp_dev *pnp_dev;
int retval;
pnp_dev = pnp_request_card_device(card, card_id->devs[0], NULL);
if (pnp_dev == NULL)
return;
retval = -ENODEV;
pnp_dev = pnp_request_card_device(card, card_id->devs[0].id, NULL);
if (!pnp_dev)
goto err;
adapter = new_adapter(pdev);
if (!pnp_port_valid(pnp_dev, 0) || !pnp_irq_valid(pnp_dev, 0))
goto err;
retval = -ENOMEM;
adapter = new_adapter((struct pci_dev *)pnp_dev); // FIXME
if (!adapter)
return -ENOMEM;
goto err;
adapter->type = AVM_FRITZ_PNP;
if (!pnp_port_valid(pnp_dev, 0) || !pnp_irq_valid(pnp_dev, 0)) {
delete_adapter(adapter);
adapter->io = pnp_port_start(pnp_dev, 0);
adapter->irq = pnp_irq(pnp_dev, 0);
......@@ -931,16 +938,20 @@ static int __devinit fcpnp_probe(struct pnp_card *card,
(char *) card_id->driver_data, adapter->io, adapter->irq);
retval = fcpcipnp_setup(adapter);
if (retval) {
if (retval)
goto err_delete;
return 0;
err_delete:
delete_adapter(adapter);
err:
return retval;
}
return 0;
}
static void __devexit fcpnp_remove(struct pnp_card *pcard)
{
struct fritz_adapter *adapter = pci_get_drvdata(pcard);
struct fritz_adapter *adapter = pnpc_get_drvdata(pcard);
fcpcipnp_release(adapter);
delete_adapter(adapter);
......@@ -997,7 +1008,7 @@ static int __init hisax_fcpcipnp_init(void)
static void __exit hisax_fcpcipnp_exit(void)
{
#ifdef __ISAPNP__
isapnp_unregister_driver(&fcpnp_driver);
pnpc_unregister_driver(&fcpnp_driver);
#endif
pci_unregister_driver(&fcpci_driver);
}
......
......@@ -190,8 +190,8 @@ static struct pnp_card *pnp_surf __devinitdata = NULL;
int __init
setup_isurf(struct IsdnCard *card)
{
int ver;
struct IsdnCardState *cs = card->cs;
unsigned long phymem;
char tmp[64];
strcpy(tmp, ISurf_revision);
......@@ -199,6 +199,7 @@ setup_isurf(struct IsdnCard *card)
if (card->para[1] && card->para[2]) {
cs->hw.isurf.reset = card->para[1];
phymem = card->para[2];
cs->irq = card->para[0];
} else {
#ifdef __ISAPNP__
......@@ -234,7 +235,7 @@ setup_isurf(struct IsdnCard *card)
return(0);
}
cs->hw.isurf.reset = pnp_port_start(pd, 0);
cs->hw.isurf.phymem = pnp_port_start(pd, 1);
phymem = pnp_port_start(pd, 1);
cs->irq = pnp_irq(pd, 0);
} else {
printk(KERN_INFO "ISurfPnP: no ISAPnP card found\n");
......@@ -252,7 +253,7 @@ setup_isurf(struct IsdnCard *card)
}
if (!request_io(&cs->rs, cs->hw.isurf.reset, 1, "isurf isdn"))
goto err;
cs->hw.isurf.isar = request_mmio(&cs->rs, card->para[2], ISURF_IOMEM_SIZE, "isurf iomem");
cs->hw.isurf.isar = request_mmio(&cs->rs, phymem, ISURF_IOMEM_SIZE, "isurf iomem");
if (!cs->hw.isurf.isar)
goto err;
......
......@@ -127,7 +127,6 @@
#define jade_TXAUDIOCH1CFG 0x17
#define jade_TXAUDIOCH2CFG 0x1A
extern int JadeVersion(struct IsdnCardState *cs, char *s);
extern void jade_sched_event(struct BCState *bcs, int event);
extern void modejade(struct BCState *bcs, int mode, int bc);
extern void initjade(struct IsdnCardState *cs);
......
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