]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] sound: fix incorrect use of platform_device_register()
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 23 Apr 2007 09:54:41 +0000 (11:54 +0200)
committerJaroslav Kysela <perex@suse.cz>
Fri, 11 May 2007 14:56:08 +0000 (16:56 +0200)
The platform_device allocated by platform_device_alloc()
should be added to the device hierarchy by platform_device_add()
instead of platform_device_register().
Otherwise it will hit WARN_ON() in platform_device_register().
by illegal refcount.
This patch fixes such incorrect usages in portman2x4 and mts64 drivers.
Also it removes unnecessary trailing whitespaces.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/drivers/mts64.c
sound/drivers/portman2x4.c

index 6c9f4c9bfeb6c3616063daf1b8fe127a65360f17..ebb1bdac7237ca6443d4cba916179515b806e084 100644 (file)
@@ -892,13 +892,13 @@ static void __devinit snd_mts64_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;
        }
index b2d0ba4bd184073ad5b07fa2a2f25a7c81d1cc1a..497cafb57d9b6ec0b16dbadc03775e82009fa88a 100644 (file)
@@ -676,13 +676,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;
        }