X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fcs4232.c;h=de40e21bf2798c6d248de7f8dbf6d0fc643cf0ab;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=7c59e2d4003a7ff7f27542d7d1dc746286653106;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index 7c59e2d40..de40e21bf 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c @@ -47,7 +47,6 @@ * Marcus Meissner Added ISA PnP support. */ -#include #include #include #include @@ -360,6 +359,8 @@ static int __initdata synthio = -1; static int __initdata synthirq = -1; static int __initdata isapnp = 1; +static unsigned int cs4232_devices; + MODULE_DESCRIPTION("CS4232 based soundcard driver"); MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); MODULE_LICENSE("GPL"); @@ -403,11 +404,11 @@ static const struct pnp_device_id cs4232_pnp_table[] = { MODULE_DEVICE_TABLE(pnp, cs4232_pnp_table); -static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) +static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) { struct address_info *isapnpcfg; - isapnpcfg=(struct address_info*)kmalloc(sizeof(*isapnpcfg),GFP_KERNEL); + isapnpcfg = kmalloc(sizeof(*isapnpcfg),GFP_KERNEL); if (!isapnpcfg) return -ENOMEM; @@ -421,6 +422,7 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev return -ENODEV; } pnp_set_drvdata(dev,isapnpcfg); + cs4232_devices++; return 0; } @@ -455,10 +457,11 @@ static int __init init_cs4232(void) #endif cfg.irq = -1; - if (isapnp && - (pnp_register_driver(&cs4232_driver) > 0) - ) - return 0; + if (isapnp) { + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) + return 0; + } if(io==-1||irq==-1||dma==-1) { @@ -503,7 +506,8 @@ static int __init setup_cs4232(char *str) int ints[7]; /* If we have isapnp cards, no need for options */ - if (pnp_register_driver(&cs4232_driver) > 0) + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) return 1; str = get_options(str, ARRAY_SIZE(ints), ints);