summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 17:05:02 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:28:24 +0100
commit175cdcfb113e2a72f9d1a2ced4b80e0ff17fcaae (patch)
treed543a187b156f9c468fae56ac4e429e1d4870338
parente2fa213591518bb1387f6042b8572c76ecdc6c6e (diff)
downloadtalos-obmc-linux-175cdcfb113e2a72f9d1a2ced4b80e0ff17fcaae.tar.gz
talos-obmc-linux-175cdcfb113e2a72f9d1a2ced4b80e0ff17fcaae.zip
[ALSA] ad1816a - Clean up PnP code
Modules: AD1816A driver Clean up PnP code of ad1816a driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/isa/ad1816a/ad1816a.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 543a4e284a40..7051f7798ed7 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -282,10 +282,8 @@ static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
static void __devexit snd_ad1816a_pnp_remove(struct pnp_card_link * pcard)
{
- struct snd_card *card = (struct snd_card *) pnp_get_card_drvdata(pcard);
-
- snd_card_disconnect(card);
- snd_card_free_in_thread(card);
+ snd_card_free(pnp_get_card_drvdata(pcard));
+ pnp_set_card_drvdata(pcard, NULL);
}
static struct pnp_card_driver ad1816a_pnpc_driver = {
@@ -294,20 +292,22 @@ static struct pnp_card_driver ad1816a_pnpc_driver = {
.id_table = snd_ad1816a_pnpids,
.probe = snd_ad1816a_pnp_detect,
.remove = __devexit_p(snd_ad1816a_pnp_remove),
+ /* FIXME: suspend/resume */
};
static int __init alsa_card_ad1816a_init(void)
{
- int cards = 0;
+ int cards;
- cards += pnp_register_card_driver(&ad1816a_pnpc_driver);
-#ifdef MODULE
- if (!cards) {
+ cards = pnp_register_card_driver(&ad1816a_pnpc_driver);
+ if (cards <= 0) {
pnp_unregister_card_driver(&ad1816a_pnpc_driver);
+#ifdef MODULE
printk(KERN_ERR "no AD1816A based soundcards found.\n");
- }
#endif /* MODULE */
- return cards ? 0 : -ENODEV;
+ return -ENODEV;
+ }
+ return 0;
}
static void __exit alsa_card_ad1816a_exit(void)
OpenPOWER on IntegriCloud