Skip to content

Commit c94ded6

Browse files
Bjorn HelgaasLinus Torvalds
authored andcommitted
[PATCH] PNP: adjust pnp_register_card_driver() signature: wavefront
Remove the assumption that pnp_register_card_driver() returns the number of devices claimed. And fix some __init/__devinit issues. Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Adam Belay <[email protected]> Cc: Jaroslav Kysela <[email protected]> Acked-by: Takashi Iwai <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3812595 commit c94ded6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sound/isa/wavefront/wavefront.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
589589
return snd_card_register(card);
590590
}
591591

592-
static int __init snd_wavefront_nonpnp_probe(struct platform_device *pdev)
592+
static int __devinit snd_wavefront_nonpnp_probe(struct platform_device *pdev)
593593
{
594594
int dev = pdev->id;
595595
struct snd_card *card;
@@ -637,6 +637,7 @@ static struct platform_driver snd_wavefront_driver = {
637637

638638

639639
#ifdef CONFIG_PNP
640+
static unsigned int __devinitdata wavefront_pnp_devices;
640641

641642
static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
642643
const struct pnp_card_device_id *pid)
@@ -670,6 +671,7 @@ static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
670671

671672
pnp_set_card_drvdata(pcard, card);
672673
dev++;
674+
wavefront_pnp_devices++;
673675
return 0;
674676
}
675677

@@ -729,10 +731,10 @@ static int __init alsa_card_wavefront_init(void)
729731
}
730732

731733
#ifdef CONFIG_PNP
732-
i = pnp_register_card_driver(&wavefront_pnpc_driver);
733-
if (i >= 0) {
734+
err = pnp_register_card_driver(&wavefront_pnpc_driver);
735+
if (!err) {
734736
pnp_registered = 1;
735-
cards += i;
737+
cards += wavefront_pnp_devices;
736738
}
737739
#endif
738740

0 commit comments

Comments
 (0)