Commit 070c6999 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

[PATCH] pnp: cs4232: adjust pnp_register_driver signature

Remove the assumption that pnp_register_driver() returns the number of devices
claimed.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 803d0abb
...@@ -360,6 +360,8 @@ static int __initdata synthio = -1; ...@@ -360,6 +360,8 @@ static int __initdata synthio = -1;
static int __initdata synthirq = -1; static int __initdata synthirq = -1;
static int __initdata isapnp = 1; static int __initdata isapnp = 1;
static unsigned int cs4232_devices;
MODULE_DESCRIPTION("CS4232 based soundcard driver"); MODULE_DESCRIPTION("CS4232 based soundcard driver");
MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -421,6 +423,7 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev ...@@ -421,6 +423,7 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev
return -ENODEV; return -ENODEV;
} }
pnp_set_drvdata(dev,isapnpcfg); pnp_set_drvdata(dev,isapnpcfg);
cs4232_devices++;
return 0; return 0;
} }
...@@ -455,10 +458,11 @@ static int __init init_cs4232(void) ...@@ -455,10 +458,11 @@ static int __init init_cs4232(void)
#endif #endif
cfg.irq = -1; cfg.irq = -1;
if (isapnp && if (isapnp) {
(pnp_register_driver(&cs4232_driver) > 0) pnp_register_driver(&cs4232_driver);
) if (cs4232_devices)
return 0; return 0;
}
if(io==-1||irq==-1||dma==-1) if(io==-1||irq==-1||dma==-1)
{ {
...@@ -503,7 +507,8 @@ static int __init setup_cs4232(char *str) ...@@ -503,7 +507,8 @@ static int __init setup_cs4232(char *str)
int ints[7]; int ints[7];
/* If we have isapnp cards, no need for options */ /* 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; return 1;
str = get_options(str, ARRAY_SIZE(ints), ints); str = get_options(str, ARRAY_SIZE(ints), ints);
......
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