ASoC: Convert pop_dbg to use dev_info

Prints from pop_dbg are enabled when dapm_pop_time != 0. Convert it to
use dev_info so that parent device of DAPM context is printed.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index e8997bb..450307c 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -91,17 +91,24 @@
 		schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
 }
 
-static void pop_dbg(u32 pop_time, const char *fmt, ...)
+static void pop_dbg(struct device *dev, u32 pop_time, const char *fmt, ...)
 {
 	va_list args;
+	char *buf;
+
+	if (!pop_time)
+		return;
+
+	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	if (buf == NULL)
+		return;
 
 	va_start(args, fmt);
-
-	if (pop_time) {
-		vprintk(fmt, args);
-	}
-
+	vsnprintf(buf, PAGE_SIZE, fmt, args);
+	dev_info(dev, buf);
 	va_end(args);
+
+	kfree(buf);
 }
 
 /* create a new dapm widget */
@@ -313,7 +320,8 @@
 
 	change = old != new;
 	if (change) {
-		pop_dbg(card->pop_time, "pop test %s : %s in %d ms\n",
+		pop_dbg(dapm->dev, card->pop_time,
+			"pop test %s : %s in %d ms\n",
 			widget->name, widget->power ? "on" : "off",
 			card->pop_time);
 		pop_wait(card->pop_time);
@@ -745,15 +753,15 @@
 		if (power)
 			value |= cur_mask;
 
-		pop_dbg(card->pop_time,
+		pop_dbg(dapm->dev, card->pop_time,
 			"pop test : Queue %s: reg=0x%x, 0x%x/0x%x\n",
 			w->name, reg, value, mask);
 
 		/* power up pre event */
 		if (w->power && w->event &&
 		    (w->event_flags & SND_SOC_DAPM_PRE_PMU)) {
-			pop_dbg(card->pop_time, "pop test : %s PRE_PMU\n",
-				w->name);
+			pop_dbg(dapm->dev, card->pop_time,
+				"pop test : %s PRE_PMU\n", w->name);
 			ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMU);
 			if (ret < 0)
 				dev_err(dapm->dev,
@@ -764,8 +772,8 @@
 		/* power down pre event */
 		if (!w->power && w->event &&
 		    (w->event_flags & SND_SOC_DAPM_PRE_PMD)) {
-			pop_dbg(card->pop_time, "pop test : %s PRE_PMD\n",
-				w->name);
+			pop_dbg(dapm->dev, card->pop_time,
+				"pop test : %s PRE_PMD\n", w->name);
 			ret = w->event(w, NULL, SND_SOC_DAPM_PRE_PMD);
 			if (ret < 0)
 				dev_err(dapm->dev,
@@ -775,7 +783,7 @@
 	}
 
 	if (reg >= 0) {
-		pop_dbg(card->pop_time,
+		pop_dbg(dapm->dev, card->pop_time,
 			"pop test : Applying 0x%x/0x%x to %x in %dms\n",
 			value, mask, reg, card->pop_time);
 		pop_wait(card->pop_time);
@@ -786,8 +794,8 @@
 		/* power up post event */
 		if (w->power && w->event &&
 		    (w->event_flags & SND_SOC_DAPM_POST_PMU)) {
-			pop_dbg(card->pop_time, "pop test : %s POST_PMU\n",
-				w->name);
+			pop_dbg(dapm->dev, card->pop_time,
+				"pop test : %s POST_PMU\n", w->name);
 			ret = w->event(w,
 				       NULL, SND_SOC_DAPM_POST_PMU);
 			if (ret < 0)
@@ -799,8 +807,8 @@
 		/* power down post event */
 		if (!w->power && w->event &&
 		    (w->event_flags & SND_SOC_DAPM_POST_PMD)) {
-			pop_dbg(card->pop_time, "pop test : %s POST_PMD\n",
-				w->name);
+			pop_dbg(dapm->dev, card->pop_time,
+				"pop test : %s POST_PMD\n", w->name);
 			ret = w->event(w, NULL, SND_SOC_DAPM_POST_PMD);
 			if (ret < 0)
 				dev_err(dapm->dev,
@@ -1025,8 +1033,8 @@
 				"Failed to apply active bias: %d\n", ret);
 	}
 
-	pop_dbg(card->pop_time, "DAPM sequencing finished, waiting %dms\n",
-		card->pop_time);
+	pop_dbg(dapm->dev, card->pop_time,
+		"DAPM sequencing finished, waiting %dms\n", card->pop_time);
 	pop_wait(card->pop_time);
 
 	return 0;