[PATCH] pnp: cs4236: adjust pnp_register_driver signature
Remove the assumption that pnp_register_driver() returns the number of devices claimed. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
f301ae6a69
commit
ed7cb19131
@@ -133,6 +133,7 @@ static int pnpc_registered;
|
|||||||
static int pnp_registered;
|
static int pnp_registered;
|
||||||
#endif
|
#endif
|
||||||
#endif /* CONFIG_PNP */
|
#endif /* CONFIG_PNP */
|
||||||
|
static unsigned int snd_cs423x_devices;
|
||||||
|
|
||||||
struct snd_card_cs4236 {
|
struct snd_card_cs4236 {
|
||||||
struct snd_cs4231 *chip;
|
struct snd_cs4231 *chip;
|
||||||
@@ -564,7 +565,7 @@ static int __init snd_cs423x_nonpnp_probe(struct platform_device *pdev)
|
|||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, card);
|
platform_set_drvdata(pdev, card);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -650,6 +651,7 @@ static int __devinit snd_cs4232_pnpbios_detect(struct pnp_dev *pdev,
|
|||||||
}
|
}
|
||||||
pnp_set_drvdata(pdev, card);
|
pnp_set_drvdata(pdev, card);
|
||||||
dev++;
|
dev++;
|
||||||
|
snd_cs423x_devices++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,6 +715,7 @@ static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
|
|||||||
}
|
}
|
||||||
pnp_set_card_drvdata(pcard, card);
|
pnp_set_card_drvdata(pcard, card);
|
||||||
dev++;
|
dev++;
|
||||||
|
snd_cs423x_devices++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,7 +724,7 @@ static void __devexit snd_cs423x_pnpc_remove(struct pnp_card_link * pcard)
|
|||||||
snd_card_free(pnp_get_card_drvdata(pcard));
|
snd_card_free(pnp_get_card_drvdata(pcard));
|
||||||
pnp_set_card_drvdata(pcard, NULL);
|
pnp_set_card_drvdata(pcard, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state)
|
static int snd_cs423x_pnpc_suspend(struct pnp_card_link *pcard, pm_message_t state)
|
||||||
{
|
{
|
||||||
@@ -766,7 +769,7 @@ static void __init_or_module snd_cs423x_unregister_all(void)
|
|||||||
|
|
||||||
static int __init alsa_card_cs423x_init(void)
|
static int __init alsa_card_cs423x_init(void)
|
||||||
{
|
{
|
||||||
int i, err, cards = 0;
|
int i, err;
|
||||||
|
|
||||||
if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
|
if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
|
||||||
return err;
|
return err;
|
||||||
@@ -782,24 +785,20 @@ static int __init alsa_card_cs423x_init(void)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
platform_devices[i] = device;
|
platform_devices[i] = device;
|
||||||
cards++;
|
snd_cs423x_devices++;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_PNP
|
#ifdef CONFIG_PNP
|
||||||
#ifdef CS4232
|
#ifdef CS4232
|
||||||
i = pnp_register_driver(&cs4232_pnp_driver);
|
err = pnp_register_driver(&cs4232_pnp_driver);
|
||||||
if (i >= 0) {
|
if (!err)
|
||||||
pnp_registered = 1;
|
pnp_registered = 1;
|
||||||
cards += i;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
i = pnp_register_card_driver(&cs423x_pnpc_driver);
|
err = pnp_register_card_driver(&cs423x_pnpc_driver);
|
||||||
if (i >= 0) {
|
if (!err)
|
||||||
pnpc_registered = 1;
|
pnpc_registered = 1;
|
||||||
cards += i;
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_PNP */
|
#endif /* CONFIG_PNP */
|
||||||
|
|
||||||
if (!cards) {
|
if (!snd_cs423x_devices) {
|
||||||
#ifdef MODULE
|
#ifdef MODULE
|
||||||
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
|
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user