diff options
Diffstat (limited to 'sound/sh')
| -rw-r--r-- | sound/sh/aica.c | 27 | ||||
| -rw-r--r-- | sound/sh/sh_dac_audio.c | 31 | 
2 files changed, 23 insertions, 35 deletions
diff --git a/sound/sh/aica.c b/sound/sh/aica.c index 94c6ea7fa7c..47849eaf266 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c @@ -29,7 +29,7 @@  #include <linux/slab.h>  #include <linux/time.h>  #include <linux/wait.h> -#include <linux/moduleparam.h> +#include <linux/module.h>  #include <linux/platform_device.h>  #include <linux/firmware.h>  #include <linux/timer.h> @@ -55,7 +55,7 @@ MODULE_FIRMWARE("aica_firmware.bin");  #define CARD_NAME "AICA"  static int index = -1;  static char *id; -static int enable = 1; +static bool enable = 1;  module_param(index, int, 0444);  MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");  module_param(id, charp, 0444); @@ -540,7 +540,7 @@ static int aica_pcmvolume_put(struct snd_kcontrol *kcontrol,  	return 1;  } -static struct snd_kcontrol_new snd_aica_pcmswitch_control __devinitdata = { +static struct snd_kcontrol_new snd_aica_pcmswitch_control = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "PCM Playback Switch",  	.index = 0, @@ -549,7 +549,7 @@ static struct snd_kcontrol_new snd_aica_pcmswitch_control __devinitdata = {  	.put = aica_pcmswitch_put  }; -static struct snd_kcontrol_new snd_aica_pcmvolume_control __devinitdata = { +static struct snd_kcontrol_new snd_aica_pcmvolume_control = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "PCM Playback Volume",  	.index = 0, @@ -574,8 +574,7 @@ static int load_aica_firmware(void)  	return err;  } -static int __devinit add_aicamixer_controls(struct snd_card_aica -					    *dreamcastcard) +static int add_aicamixer_controls(struct snd_card_aica *dreamcastcard)  {  	int err;  	err = snd_ctl_add @@ -591,7 +590,7 @@ static int __devinit add_aicamixer_controls(struct snd_card_aica  	return 0;  } -static int __devexit snd_aica_remove(struct platform_device *devptr) +static int snd_aica_remove(struct platform_device *devptr)  {  	struct snd_card_aica *dreamcastcard;  	dreamcastcard = platform_get_drvdata(devptr); @@ -599,19 +598,18 @@ static int __devexit snd_aica_remove(struct platform_device *devptr)  		return -ENODEV;  	snd_card_free(dreamcastcard->card);  	kfree(dreamcastcard); -	platform_set_drvdata(devptr, NULL);  	return 0;  } -static int __devinit snd_aica_probe(struct platform_device *devptr) +static int snd_aica_probe(struct platform_device *devptr)  {  	int err;  	struct snd_card_aica *dreamcastcard;  	dreamcastcard = kmalloc(sizeof(struct snd_card_aica), GFP_KERNEL);  	if (unlikely(!dreamcastcard))  		return -ENOMEM; -	err = snd_card_create(index, SND_AICA_DRIVER, THIS_MODULE, 0, -			      &dreamcastcard->card); +	err = snd_card_new(&devptr->dev, index, SND_AICA_DRIVER, +			   THIS_MODULE, 0, &dreamcastcard->card);  	if (unlikely(err < 0)) {  		kfree(dreamcastcard);  		return err; @@ -626,7 +624,6 @@ static int __devinit snd_aica_probe(struct platform_device *devptr)  	err = snd_aicapcmchip(dreamcastcard, 0);  	if (unlikely(err < 0))  		goto freedreamcast; -	snd_card_set_dev(dreamcastcard->card, &devptr->dev);  	dreamcastcard->timer.data = 0;  	dreamcastcard->channel = NULL;  	/* Add basic controls */ @@ -652,9 +649,11 @@ static int __devinit snd_aica_probe(struct platform_device *devptr)  static struct platform_driver snd_aica_driver = {  	.probe = snd_aica_probe, -	.remove = __devexit_p(snd_aica_remove), +	.remove = snd_aica_remove,  	.driver = { -		   .name = SND_AICA_DRIVER}, +		.name = SND_AICA_DRIVER, +		.owner	= THIS_MODULE, +	},  };  static int __init aica_init(void) diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index 68e0dee4ff0..d1fb74dabbd 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c @@ -27,6 +27,7 @@  #include <linux/io.h>  #include <linux/platform_device.h>  #include <linux/slab.h> +#include <linux/module.h>  #include <sound/core.h>  #include <sound/initval.h>  #include <sound/pcm.h> @@ -260,7 +261,7 @@ static struct snd_pcm_ops snd_sh_dac_pcm_ops = {  	.mmap		= snd_pcm_lib_mmap_iomem,  }; -static int __devinit snd_sh_dac_pcm(struct snd_sh_dac *chip, int device) +static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)  {  	int err;  	struct snd_pcm *pcm; @@ -289,8 +290,6 @@ static int __devinit snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)  static int snd_sh_dac_remove(struct platform_device *devptr)  {  	snd_card_free(platform_get_drvdata(devptr)); -	platform_set_drvdata(devptr, NULL); -  	return 0;  } @@ -345,9 +344,9 @@ static enum hrtimer_restart sh_dac_audio_timer(struct hrtimer *handle)  }  /* create  --  chip-specific constructor for the cards components */ -static int __devinit snd_sh_dac_create(struct snd_card *card, -				       struct platform_device *devptr, -				       struct snd_sh_dac **rchip) +static int snd_sh_dac_create(struct snd_card *card, +			     struct platform_device *devptr, +			     struct snd_sh_dac **rchip)  {  	struct snd_sh_dac *chip;  	int err; @@ -391,13 +390,13 @@ static int __devinit snd_sh_dac_create(struct snd_card *card,  }  /* driver .probe  --  constructor */ -static int __devinit snd_sh_dac_probe(struct platform_device *devptr) +static int snd_sh_dac_probe(struct platform_device *devptr)  {  	struct snd_sh_dac *chip;  	struct snd_card *card;  	int err; -	err = snd_card_create(index, id, THIS_MODULE, 0, &card); +	err = snd_card_new(&devptr->dev, index, id, THIS_MODULE, 0, &card);  	if (err < 0) {  			snd_printk(KERN_ERR "cannot allocate the card\n");  			return err; @@ -432,23 +431,13 @@ probe_error:  /*   * "driver" definition   */ -static struct platform_driver driver = { +static struct platform_driver sh_dac_driver = {  	.probe	= snd_sh_dac_probe,  	.remove = snd_sh_dac_remove,  	.driver = {  		.name = "dac_audio", +		.owner	= THIS_MODULE,  	},  }; -static int __init sh_dac_init(void) -{ -	return platform_driver_register(&driver); -} - -static void __exit sh_dac_exit(void) -{ -	platform_driver_unregister(&driver); -} - -module_init(sh_dac_init); -module_exit(sh_dac_exit); +module_platform_driver(sh_dac_driver);  | 
