Skip to contentSkip to conversation

sound: fix incorrect use of platform_device_register()

PATCH Applied Akinobu Mita 2 participants 2 messages Apr 21, 2007 – Apr 23, 2007 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Jaroslav Kysela <[email protected]>
sound/drivers/portman2x4.c +2 -2
Index: 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;
 	}
sound/drivers/mts64.c +2 -2
Index: 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;
 	}
Applied
#1 lore raw

At Sat, 21 Apr 2007 16:23:39 +0900,

Quoted 5 lines · Akinobu Mita

The platform_device allocated by platform_device_alloc() should be added to the device hierarchy by platform_device_add() instead of platform_device_register().

Quoted 8 lines

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 <[email protected]>

Thanks, applied to ALSA tree now.

Takashi