提交 479ef436 编写于 作者: A Akinobu Mita 提交者: Jaroslav Kysela

[ALSA] sound: fix incorrect use of platform_device_register()

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: NAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NJaroslav Kysela <perex@suse.cz>
上级 9422db40
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册