X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=sound%2Fsparc%2Fcs4231.c;h=8d13d933087dee455186d568e2ba4364988225ba;hb=84ed1a1942e8c28fb4c23a6235ec48672fc43e49;hp=cdbfae96bd88e5f3dfdfcb06b6947fa73dcf987d;hpb=afc88ad6b38797aeec4d635140099ace077df587;p=safe%2Fjmp%2Flinux-2.6 diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index cdbfae9..8d13d93 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -703,7 +703,7 @@ static int snd_cs4231_timer_stop(struct snd_timer *timer) return 0; } -static void __init snd_cs4231_init(struct snd_cs4231 *chip) +static void __devinit snd_cs4231_init(struct snd_cs4231 *chip) { unsigned long flags; @@ -1020,7 +1020,7 @@ static snd_pcm_uframes_t snd_cs4231_capture_pointer( return bytes_to_frames(substream->runtime, ptr); } -static int __init snd_cs4231_probe(struct snd_cs4231 *chip) +static int __devinit snd_cs4231_probe(struct snd_cs4231 *chip) { unsigned long flags; int i; @@ -1219,7 +1219,7 @@ static struct snd_pcm_ops snd_cs4231_capture_ops = { .pointer = snd_cs4231_capture_pointer, }; -static int __init snd_cs4231_pcm(struct snd_card *card) +static int __devinit snd_cs4231_pcm(struct snd_card *card) { struct snd_cs4231 *chip = card->private_data; struct snd_pcm *pcm; @@ -1248,7 +1248,7 @@ static int __init snd_cs4231_pcm(struct snd_card *card) return 0; } -static int __init snd_cs4231_timer(struct snd_card *card) +static int __devinit snd_cs4231_timer(struct snd_card *card) { struct snd_cs4231 *chip = card->private_data; struct snd_timer *timer; @@ -1499,7 +1499,7 @@ static int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \ ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) } -static struct snd_kcontrol_new snd_cs4231_controls[] __initdata = { +static struct snd_kcontrol_new snd_cs4231_controls[] __devinitdata = { CS4231_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT, @@ -1538,12 +1538,13 @@ CS4231_SINGLE("Line Out Switch", 0, CS4231_PIN_CTRL, 6, 1, 1), CS4231_SINGLE("Headphone Out Switch", 0, CS4231_PIN_CTRL, 7, 1, 1) }; -static int __init snd_cs4231_mixer(struct snd_card *card) +static int __devinit snd_cs4231_mixer(struct snd_card *card) { struct snd_cs4231 *chip = card->private_data; int err, idx; - snd_assert(chip != NULL && chip->pcm != NULL, return -EINVAL); + if (snd_BUG_ON(!chip || !chip->pcm)) + return -EINVAL; strcpy(card->mixername, chip->pcm->name); @@ -1558,10 +1559,11 @@ static int __init snd_cs4231_mixer(struct snd_card *card) static int dev; -static int __init cs4231_attach_begin(struct snd_card **rcard) +static int __devinit cs4231_attach_begin(struct snd_card **rcard) { struct snd_card *card; struct snd_cs4231 *chip; + int err; *rcard = NULL; @@ -1573,10 +1575,10 @@ static int __init cs4231_attach_begin(struct snd_card **rcard) return -ENOENT; } - card = snd_card_new(index[dev], id[dev], THIS_MODULE, - sizeof(struct snd_cs4231)); - if (card == NULL) - return -ENOMEM; + err = snd_card_create(index[dev], id[dev], THIS_MODULE, + sizeof(struct snd_cs4231), &card); + if (err < 0) + return err; strcpy(card->driver, "CS4231"); strcpy(card->shortname, "Sun CS4231"); @@ -1588,7 +1590,7 @@ static int __init cs4231_attach_begin(struct snd_card **rcard) return 0; } -static int __init cs4231_attach_finish(struct snd_card *card) +static int __devinit cs4231_attach_finish(struct snd_card *card) { struct snd_cs4231 *chip = card->private_data; int err; @@ -1792,9 +1794,9 @@ static struct snd_device_ops snd_cs4231_sbus_dev_ops = { .dev_free = snd_cs4231_sbus_dev_free, }; -static int __init snd_cs4231_sbus_create(struct snd_card *card, - struct of_device *op, - int dev) +static int __devinit snd_cs4231_sbus_create(struct snd_card *card, + struct of_device *op, + int dev) { struct snd_cs4231 *chip = card->private_data; int err; @@ -1958,9 +1960,9 @@ static struct snd_device_ops snd_cs4231_ebus_dev_ops = { .dev_free = snd_cs4231_ebus_dev_free, }; -static int __init snd_cs4231_ebus_create(struct snd_card *card, - struct of_device *op, - int dev) +static int __devinit snd_cs4231_ebus_create(struct snd_card *card, + struct of_device *op, + int dev) { struct snd_cs4231 *chip = card->private_data; int err; @@ -2056,7 +2058,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev if (err) return err; - sprintf(card->longname, "%s at 0x%lx, irq %d", + sprintf(card->longname, "%s at 0x%llx, irq %d", card->shortname, op->resource[0].start, op->irqs[0]); @@ -2094,7 +2096,7 @@ static int __devexit cs4231_remove(struct of_device *op) return 0; } -static struct of_device_id cs4231_match[] = { +static const struct of_device_id cs4231_match[] = { { .name = "SUNW,CS4231", },