Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[safe/jmp/linux-2.6] / sound / sparc / cs4231.c
index 6c427bb..7dcc065 100644 (file)
@@ -10,7 +10,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -703,7 +702,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 +1019,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 +1218,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 +1247,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 +1498,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,7 +1537,7 @@ 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;
@@ -1559,10 +1558,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;
 
@@ -1574,10 +1574,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");
@@ -1589,7 +1589,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;
@@ -1793,9 +1793,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;
@@ -1856,7 +1856,7 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card,
        return 0;
 }
 
-static int __init cs4231_sbus_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct resource *rp = &op->resource[0];
        struct snd_card *card;
@@ -1959,9 +1959,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;
@@ -2048,7 +2048,7 @@ static int __init snd_cs4231_ebus_create(struct snd_card *card,
        return 0;
 }
 
-static int __init cs4231_ebus_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_device_id *match)
 {
        struct snd_card *card;
        int err;
@@ -2057,7 +2057,7 @@ static int __init cs4231_ebus_probe(struct of_device *op, const struct of_device
        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]);
@@ -2072,7 +2072,7 @@ static int __init cs4231_ebus_probe(struct of_device *op, const struct of_device
 }
 #endif
 
-static int __init cs4231_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_probe(struct of_device *op, const struct of_device_id *match)
 {
 #ifdef EBUS_SUPPORT
        if (!strcmp(op->node->parent->name, "ebus"))
@@ -2086,7 +2086,7 @@ static int __init cs4231_probe(struct of_device *op, const struct of_device_id *
        return -ENODEV;
 }
 
-static int __exit cs4231_remove(struct of_device *op)
+static int __devexit cs4231_remove(struct of_device *op)
 {
        struct snd_cs4231 *chip = dev_get_drvdata(&op->dev);
 
@@ -2112,7 +2112,7 @@ static struct of_platform_driver cs4231_driver = {
        .name           = "audio",
        .match_table    = cs4231_match,
        .probe          = cs4231_probe,
-       .remove         = __exit_p(cs4231_remove),
+       .remove         = __devexit_p(cs4231_remove),
 };
 
 static int __init cs4231_init(void)