Commit 418c8f89911dd3d4930221def3bd56b38b051789

Authored by Uwe Kleine-König
Committed by Jaroslav Kysela
1 parent f7cf0a7ce5

ALSA: Fix section for snd-aica platform driver

Don't use __init but __devinit to define probe function.  A pointer to
snd_aica_probe is passed to the core via platform_driver_register and so the
function must not disappear after the module is loaded.  Using __init
and having HOTPLUG=y and SND_AICA=m the following probably oopses:

	echo -n AICA > /sys/bus/platform/driver/AICA/unbind
	echo -n AICA > /sys/bus/platform/driver/AICA/bind

Strange enough add_aicamixer_controls which is only called by
snd_aica_probe was already using __devinit.

While at it move the remove function to .devexit.text section.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -590,7 +590,7 @@
590 590 return 0;
591 591 }
592 592  
593   -static int snd_aica_remove(struct platform_device *devptr)
  593 +static int __devexit snd_aica_remove(struct platform_device *devptr)
594 594 {
595 595 struct snd_card_aica *dreamcastcard;
596 596 dreamcastcard = platform_get_drvdata(devptr);
... ... @@ -602,7 +602,7 @@
602 602 return 0;
603 603 }
604 604  
605   -static int __init snd_aica_probe(struct platform_device *devptr)
  605 +static int __devinit snd_aica_probe(struct platform_device *devptr)
606 606 {
607 607 int err;
608 608 struct snd_card_aica *dreamcastcard;
... ... @@ -651,7 +651,7 @@
651 651  
652 652 static struct platform_driver snd_aica_driver = {
653 653 .probe = snd_aica_probe,
654   - .remove = snd_aica_remove,
  654 + .remove = __devexit_p(snd_aica_remove),
655 655 .driver = {
656 656 .name = SND_AICA_DRIVER},
657 657 };