Skip to content

Commit

Permalink
ALSA: Fix section for snd-aica platform driver
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Adrian McMenamin <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
  • Loading branch information
Uwe Kleine-König authored and perexg committed Sep 23, 2008
1 parent f7cf0a7 commit 418c8f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/sh/aica.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ static int __devinit add_aicamixer_controls(struct snd_card_aica
return 0;
}

static int snd_aica_remove(struct platform_device *devptr)
static int __devexit snd_aica_remove(struct platform_device *devptr)
{
struct snd_card_aica *dreamcastcard;
dreamcastcard = platform_get_drvdata(devptr);
Expand All @@ -602,7 +602,7 @@ static int snd_aica_remove(struct platform_device *devptr)
return 0;
}

static int __init snd_aica_probe(struct platform_device *devptr)
static int __devinit snd_aica_probe(struct platform_device *devptr)
{
int err;
struct snd_card_aica *dreamcastcard;
Expand Down Expand Up @@ -651,7 +651,7 @@ static int __init snd_aica_probe(struct platform_device *devptr)

static struct platform_driver snd_aica_driver = {
.probe = snd_aica_probe,
.remove = snd_aica_remove,
.remove = __devexit_p(snd_aica_remove),
.driver = {
.name = SND_AICA_DRIVER},
};
Expand Down

0 comments on commit 418c8f8

Please sign in to comment.