Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 479ef436 authored by Akinobu Mita's avatar Akinobu Mita Committed by Jaroslav Kysela
Browse files

[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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 9422db40
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -898,7 +898,7 @@ static void __devinit snd_mts64_attach(struct parport *p)
	/* Temporary assignment to forward the parport */
	/* Temporary assignment to forward the parport */
	platform_set_drvdata(device, p);
	platform_set_drvdata(device, p);


	if (platform_device_register(device) < 0) {
	if (platform_device_add(device) < 0) {
		platform_device_put(device);
		platform_device_put(device);
		return;
		return;
	}
	}
+2 −2
Original line number Original line Diff line number Diff line
@@ -682,7 +682,7 @@ static void __devinit snd_portman_attach(struct parport *p)
	/* Temporary assignment to forward the parport */
	/* Temporary assignment to forward the parport */
	platform_set_drvdata(device, p);
	platform_set_drvdata(device, p);


	if (platform_device_register(device) < 0) {
	if (platform_device_add(device) < 0) {
		platform_device_put(device);
		platform_device_put(device);
		return;
		return;
	}
	}