Commit 175cdcfb authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] ad1816a - Clean up PnP code

Modules: AD1816A driver

Clean up PnP code of ad1816a driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e2fa2135
......@@ -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)
......
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