* [PATCH] sound: fix incorrect use of platform_device_register()
@ 2007-04-21 7:23 Akinobu Mita
2007-04-23 9:55 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2007-04-21 7:23 UTC (permalink / raw)
To: alsa-devel; +Cc: Jaroslav Kysela
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.
Cc: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Index: 2.6-mm/sound/drivers/portman2x4.c
===================================================================
--- 2.6-mm.orig/sound/drivers/portman2x4.c
+++ 2.6-mm/sound/drivers/portman2x4.c
@@ -676,13 +676,13 @@ static void __devinit snd_portman_attach
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: 2.6-mm/sound/drivers/mts64.c
===================================================================
--- 2.6-mm.orig/sound/drivers/mts64.c
+++ 2.6-mm/sound/drivers/mts64.c
@@ -892,13 +892,13 @@ static void __devinit snd_mts64_attach(s
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] sound: fix incorrect use of platform_device_register()
2007-04-21 7:23 [PATCH] sound: fix incorrect use of platform_device_register() Akinobu Mita
@ 2007-04-23 9:55 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2007-04-23 9:55 UTC (permalink / raw)
To: Akinobu Mita; +Cc: alsa-devel, Jaroslav Kysela
At Sat, 21 Apr 2007 16:23:39 +0900,
Akinobu Mita wrote:
>
> 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.
>
> Cc: Jaroslav Kysela <perex@suse.cz>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Thanks, applied to ALSA tree now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-23 9:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-21 7:23 [PATCH] sound: fix incorrect use of platform_device_register() Akinobu Mita
2007-04-23 9:55 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.