Merge branch 'fix/pcm-jiffies-check' into for-linus
[safe/jmp/linux-2.6] / sound / drivers / portman2x4.c
index b2d0ba4..60158e2 100644 (file)
@@ -37,7 +37,6 @@
  *      - ported from alsa 0.5 to 1.0
  */
 
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/parport.h>
@@ -611,7 +610,7 @@ static int __devinit snd_portman_rawmidi_create(struct snd_card *card)
 /*********************************************************************
  * parport stuff
  *********************************************************************/
-static void snd_portman_interrupt(int irq, void *userdata)
+static void snd_portman_interrupt(void *userdata)
 {
        unsigned char midivalue = 0;
        struct portman *pm = ((struct snd_card*)userdata)->private_data;
@@ -668,7 +667,7 @@ static int __devinit snd_portman_probe_port(struct parport *p)
        parport_release(pardev);
        parport_unregister_device(pardev);
 
-       return res;
+       return res ? -EIO : 0;
 }
 
 static void __devinit snd_portman_attach(struct parport *p)
@@ -676,13 +675,13 @@ static void __devinit snd_portman_attach(struct parport *p)
        struct platform_device *device;
 
        device = platform_device_alloc(PLATFORM_DRIVER, device_count);
-       if (!device) 
+       if (!device)
                return;
 
        /* Temporary assignment to forward the parport */
        platform_set_drvdata(device, p);
 
-       if (platform_device_register(device) < 0) {
+       if (platform_device_add(device) < 0) {
                platform_device_put(device);
                return;
        }
@@ -747,10 +746,10 @@ static int __devinit snd_portman_probe(struct platform_device *pdev)
        if ((err = snd_portman_probe_port(p)) < 0)
                return err;
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
-       if (card == NULL) {
+       err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+       if (err < 0) {
                snd_printd("Cannot create card\n");
-               return -ENOMEM;
+               return err;
        }
        strcpy(card->driver, DRIVER_NAME);
        strcpy(card->shortname, CARD_NAME);
@@ -797,6 +796,8 @@ static int __devinit snd_portman_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, card);
 
+       snd_card_set_dev(card, &pdev->dev);
+
        /* At this point card will be usable */
        if ((err = snd_card_register(card)) < 0) {
                snd_printd("Cannot register card\n");
@@ -833,7 +834,7 @@ static struct platform_driver snd_portman_driver = {
 /*********************************************************************
  * module init stuff
  *********************************************************************/
-static void __init_or_module snd_portman_unregister_all(void)
+static void snd_portman_unregister_all(void)
 {
        int i;