diff --git a/sound/core/control.c b/sound/core/control.c
index 03ae9bb..f8f98cc 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -195,8 +195,10 @@
 	snd_assert(control != NULL, return NULL);
 	snd_assert(control->count > 0, return NULL);
 	kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL);
-	if (kctl == NULL)
+	if (kctl == NULL) {
+		snd_printk(KERN_ERR "Cannot allocate control instance\n");
 		return NULL;
+	}
 	*kctl = *control;
 	for (idx = 0; idx < kctl->count; idx++)
 		kctl->vd[idx].access = access;
@@ -309,7 +311,9 @@
 	struct snd_ctl_elem_id id;
 	unsigned int idx;
 
-	snd_assert(card != NULL && kcontrol != NULL, return -EINVAL);
+	snd_assert(card != NULL, return -EINVAL);
+	if (! kcontrol)
+		return -EINVAL;
 	snd_assert(kcontrol->info != NULL, return -EINVAL);
 	id = kcontrol->id;
 	down_write(&card->controls_rwsem);
diff --git a/sound/core/device.c b/sound/core/device.c
index afa8cc7..b1cf6ec 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -50,8 +50,10 @@
 	snd_assert(device_data != NULL, return -ENXIO);
 	snd_assert(ops != NULL, return -ENXIO);
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
-	if (dev == NULL)
+	if (dev == NULL) {
+		snd_printk(KERN_ERR "Cannot allocate device\n");
 		return -ENOMEM;
+	}
 	dev->card = card;
 	dev->type = type;
 	dev->state = SNDRV_DEV_BUILD;
@@ -173,6 +175,7 @@
 			dev->state = SNDRV_DEV_REGISTERED;
 			return 0;
 		}
+		snd_printd("snd_device_register busy\n");
 		return -EBUSY;
 	}
 	snd_BUG();
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index da0fb9f..444e266 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -364,13 +364,14 @@
 	*rhwdep = NULL;
 	snd_assert(card != NULL, return -ENXIO);
 	hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL);
-	if (hwdep == NULL)
+	if (hwdep == NULL) {
+		snd_printk(KERN_ERR "hwdep: cannot allocate\n");
 		return -ENOMEM;
+	}
 	hwdep->card = card;
 	hwdep->device = device;
-	if (id) {
+	if (id)
 		strlcpy(hwdep->id, id, sizeof(hwdep->id));
-	}
 #ifdef CONFIG_SND_OSSEMUL
 	hwdep->oss_type = -1;
 #endif
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 59c995b..9305ac3 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -600,14 +600,18 @@
 	pstr->reg = &snd_pcm_reg[stream];
 	if (substream_count > 0) {
 		err = snd_pcm_stream_proc_init(pstr);
-		if (err < 0)
+		if (err < 0) {
+			snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
 			return err;
+		}
 	}
 	prev = NULL;
 	for (idx = 0, prev = NULL; idx < substream_count; idx++) {
 		substream = kzalloc(sizeof(*substream), GFP_KERNEL);
-		if (substream == NULL)
+		if (substream == NULL) {
+			snd_printk(KERN_ERR "Cannot allocate PCM substream\n");
 			return -ENOMEM;
+		}
 		substream->pcm = pcm;
 		substream->pstr = pstr;
 		substream->number = idx;
@@ -620,6 +624,7 @@
 			prev->next = substream;
 		err = snd_pcm_substream_proc_init(substream);
 		if (err < 0) {
+			snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n");
 			kfree(substream);
 			return err;
 		}
@@ -666,13 +671,14 @@
 	*rpcm = NULL;
 	snd_assert(card != NULL, return -ENXIO);
 	pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
-	if (pcm == NULL)
+	if (pcm == NULL) {
+		snd_printk(KERN_ERR "Cannot allocate PCM\n");
 		return -ENOMEM;
+	}
 	pcm->card = card;
 	pcm->device = device;
-	if (id) {
+	if (id)
 		strlcpy(pcm->id, id, sizeof(pcm->id));
-	}
 	if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) {
 		snd_pcm_free(pcm);
 		return err;
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index ede0a60..7a86a9a 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1382,8 +1382,10 @@
 	INIT_LIST_HEAD(&stream->substreams);
 	for (idx = 0; idx < count; idx++) {
 		substream = kzalloc(sizeof(*substream), GFP_KERNEL);
-		if (substream == NULL)
+		if (substream == NULL) {
+			snd_printk(KERN_ERR "rawmidi: cannot allocate substream\n");
 			return -ENOMEM;
+		}
 		substream->stream = direction;
 		substream->number = idx;
 		substream->rmidi = rmidi;
@@ -1425,19 +1427,27 @@
 	*rrawmidi = NULL;
 	snd_assert(card != NULL, return -ENXIO);
 	rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL);
-	if (rmidi == NULL)
+	if (rmidi == NULL) {
+		snd_printk(KERN_ERR "rawmidi: cannot allocate\n");
 		return -ENOMEM;
+	}
 	rmidi->card = card;
 	rmidi->device = device;
 	init_MUTEX(&rmidi->open_mutex);
 	init_waitqueue_head(&rmidi->open_wait);
 	if (id != NULL)
 		strlcpy(rmidi->id, id, sizeof(rmidi->id));
-	if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT], SNDRV_RAWMIDI_STREAM_INPUT, input_count)) < 0) {
+	if ((err = snd_rawmidi_alloc_substreams(rmidi,
+						&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT],
+						SNDRV_RAWMIDI_STREAM_INPUT,
+						input_count)) < 0) {
 		snd_rawmidi_free(rmidi);
 		return err;
 	}
-	if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT], SNDRV_RAWMIDI_STREAM_OUTPUT, output_count)) < 0) {
+	if ((err = snd_rawmidi_alloc_substreams(rmidi,
+						&rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT],
+						SNDRV_RAWMIDI_STREAM_OUTPUT,
+						output_count)) < 0) {
 		snd_rawmidi_free(rmidi);
 		return err;
 	}
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 18d43a0..74637ce 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -777,8 +777,10 @@
 	snd_assert(rtimer != NULL, return -EINVAL);
 	*rtimer = NULL;
 	timer = kzalloc(sizeof(*timer), GFP_KERNEL);
-	if (timer == NULL)
+	if (timer == NULL) {
+		snd_printk(KERN_ERR "timer: cannot allocate\n");
 		return -ENOMEM;
+	}
 	timer->tmr_class = tid->dev_class;
 	timer->card = card;
 	timer->tmr_device = tid->device;
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index 16e87f3..ee67b52 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -462,6 +462,7 @@
 		return err;
 	mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
 	if (mpu == NULL) {
+		snd_printk(KERN_ERR "mpu401_uart: cannot allocate\n");
 		snd_device_free(card, rmidi);
 		return -ENOMEM;
 	}
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index cbd37e9..650f3b8 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -349,8 +349,10 @@
 
 	*ropl3 = NULL;
 	opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
-	if (opl3 == NULL)
+	if (opl3 == NULL) {
+		snd_printk(KERN_ERR "opl3: cannot allocate\n");
 		return -ENOMEM;
+	}
 
 	opl3->card = card;
 	opl3->hardware = hardware;
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index b923de9..aafe556 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -496,21 +496,29 @@
 	/* reassign AUX0 to CD */
         strcpy(id1.name, "Aux Playback Switch");
         strcpy(id2.name, "CD Playback Switch");
-        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
+        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) {
+		snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n");
                 return err;
+	}
         strcpy(id1.name, "Aux Playback Volume");
         strcpy(id2.name, "CD Playback Volume");
-        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
+        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) {
+		snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n");
                 return err;
+	}
 	/* reassign AUX1 to FM */
         strcpy(id1.name, "Aux Playback Switch"); id1.index = 1;
         strcpy(id2.name, "FM Playback Switch");
-        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
+        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) {
+		snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n");
                 return err;
+	}
         strcpy(id1.name, "Aux Playback Volume");
         strcpy(id2.name, "FM Playback Volume");
-        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0)
+        if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) {
+		snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n");
                 return err;
+	}
 	/* add OPL3SA2 controls */
 	for (idx = 0; idx < ARRAY_SIZE(snd_opl3sa2_controls); idx++) {
 		if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_opl3sa2_controls[idx], chip))) < 0)
@@ -575,8 +583,10 @@
 	int err;
 
 	cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
-	if (!cfg)
+	if (!cfg) {
+		snd_printk(KERN_ERR PFX "cannot allocate pnp cfg\n");
 		return -ENOMEM;
+	}
 	/* PnP initialization */
 	pnp_init_resource_table(cfg);
 	if (sb_port[dev] != SNDRV_AUTO_PORT)
@@ -597,7 +607,7 @@
 		pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
 	err = pnp_manual_config_dev(pdev, cfg, 0);
 	if (err < 0)
-		snd_printk(KERN_ERR "PnP manual resources are invalid, using auto config\n");
+		snd_printk(KERN_WARNING "PnP manual resources are invalid, using auto config\n");
 	err = pnp_activate_dev(pdev);
 	if (err < 0) {
 		kfree(cfg);
@@ -784,8 +794,11 @@
 	struct snd_card *card;
 
 	pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL);
-	if (pdev == NULL)
+	if (pdev == NULL) {
+		snd_printk(KERN_ERR PFX "can't get pnp device from id '%s'\n",
+			   id->devs[0].id);
 		return -EBUSY;
+	}
 	for (; dev < SNDRV_CARDS; dev++) {
 		if (enable[dev] && isapnp[dev])
 			break;
