ALSA: usb-audio: Use standard printk helpers

Convert with dev_err() and co from snd_printk(), etc.
As there are too deep indirections (e.g. ep->chip->dev->dev),
a few new local macros, usb_audio_err() & co, are introduced.

Also, the device numbers in some messages are dropped, as they are
shown in the prefix automatically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index 86f80c6..03fed66 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -115,9 +115,9 @@
 		return ret;
 
 	if (ret != sizeof(pin)) {
-		snd_printk(KERN_ERR
-			"usb-audio:%d: setting selector (id %d) unexpected length %d\n",
-			chip->dev->devnum, selector_id, ret);
+		usb_audio_err(chip,
+			"setting selector (id %d) unexpected length %d\n",
+			selector_id, ret);
 		return -EINVAL;
 	}
 
@@ -126,9 +126,9 @@
 		return ret;
 
 	if (ret != pin) {
-		snd_printk(KERN_ERR
-			"usb-audio:%d: setting selector (id %d) to %x failed (current: %d)\n",
-			chip->dev->devnum, selector_id, pin, ret);
+		usb_audio_err(chip,
+			"setting selector (id %d) to %x failed (current: %d)\n",
+			selector_id, pin, ret);
 		return -EINVAL;
 	}
 
@@ -158,7 +158,8 @@
 			      &data, sizeof(data));
 
 	if (err < 0) {
-		snd_printk(KERN_WARNING "%s(): cannot get clock validity for id %d\n",
+		dev_warn(&dev->dev,
+			 "%s(): cannot get clock validity for id %d\n",
 			   __func__, source_id);
 		return 0;
 	}
@@ -177,9 +178,9 @@
 	entity_id &= 0xff;
 
 	if (test_and_set_bit(entity_id, visited)) {
-		snd_printk(KERN_WARNING
-			"%s(): recursive clock topology detected, id %d.\n",
-			__func__, entity_id);
+		usb_audio_warn(chip,
+			 "%s(): recursive clock topology detected, id %d.\n",
+			 __func__, entity_id);
 		return -EINVAL;
 	}
 
@@ -188,8 +189,9 @@
 	if (source) {
 		entity_id = source->bClockID;
 		if (validate && !uac_clock_source_is_valid(chip, entity_id)) {
-			snd_printk(KERN_ERR "usb-audio:%d: clock source %d is not valid, cannot use\n",
-				   chip->dev->devnum, entity_id);
+			usb_audio_err(chip,
+				"clock source %d is not valid, cannot use\n",
+				entity_id);
 			return -ENXIO;
 		}
 		return entity_id;
@@ -208,7 +210,7 @@
 		/* Selector values are one-based */
 
 		if (ret > selector->bNrInPins || ret < 1) {
-			snd_printk(KERN_ERR
+			usb_audio_err(chip,
 				"%s(): selector reported illegal value, id %d, ret %d\n",
 				__func__, selector->bClockID, ret);
 
@@ -237,9 +239,9 @@
 			if (err < 0)
 				continue;
 
-			snd_printk(KERN_INFO
-				"usb-audio:%d: found and selected valid clock source %d\n",
-				chip->dev->devnum, ret);
+			usb_audio_info(chip,
+				 "found and selected valid clock source %d\n",
+				 ret);
 			return ret;
 		}
 
@@ -296,8 +298,8 @@
 				   USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_OUT,
 				   UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,
 				   data, sizeof(data))) < 0) {
-		snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep %#x\n",
-			   dev->devnum, iface, fmt->altsetting, rate, ep);
+		dev_err(&dev->dev, "%d:%d: cannot set freq %d to ep %#x\n",
+			iface, fmt->altsetting, rate, ep);
 		return err;
 	}
 
@@ -305,14 +307,14 @@
 				   USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN,
 				   UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,
 				   data, sizeof(data))) < 0) {
-		snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep %#x\n",
-			   dev->devnum, iface, fmt->altsetting, ep);
+		dev_err(&dev->dev, "%d:%d: cannot get freq at ep %#x\n",
+			iface, fmt->altsetting, ep);
 		return 0; /* some devices don't support reading */
 	}
 
 	crate = data[0] | (data[1] << 8) | (data[2] << 16);
 	if (crate != rate) {
-		snd_printd(KERN_WARNING "current rate %d is different from the runtime rate %d\n", crate, rate);
+		dev_warn(&dev->dev, "current rate %d is different from the runtime rate %d\n", crate, rate);
 		// runtime->rate = crate;
 	}
 
@@ -332,8 +334,8 @@
 			      snd_usb_ctrl_intf(chip) | (clock << 8),
 			      &data, sizeof(data));
 	if (err < 0) {
-		snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq (v2): err %d\n",
-			   dev->devnum, iface, altsetting, err);
+		dev_warn(&dev->dev, "%d:%d: cannot get freq (v2): err %d\n",
+			 iface, altsetting, err);
 		return 0;
 	}
 
@@ -369,8 +371,9 @@
 				      snd_usb_ctrl_intf(chip) | (clock << 8),
 				      &data, sizeof(data));
 		if (err < 0) {
-			snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d (v2): err %d\n",
-				   dev->devnum, iface, fmt->altsetting, rate, err);
+			usb_audio_err(chip,
+				"%d:%d: cannot set freq %d (v2): err %d\n",
+				iface, fmt->altsetting, rate, err);
 			return err;
 		}
 
@@ -381,14 +384,14 @@
 
 	if (cur_rate != rate) {
 		if (!writeable) {
-			snd_printk(KERN_WARNING
-				   "%d:%d:%d: freq mismatch (RO clock): req %d, clock runs @%d\n",
-				   dev->devnum, iface, fmt->altsetting, rate, cur_rate);
+			usb_audio_warn(chip,
+				 "%d:%d: freq mismatch (RO clock): req %d, clock runs @%d\n",
+				 iface, fmt->altsetting, rate, cur_rate);
 			return -ENXIO;
 		}
-		snd_printd(KERN_WARNING
-			   "current rate %d is different from the runtime rate %d\n",
-			   cur_rate, rate);
+		usb_audio_dbg(chip,
+			"current rate %d is different from the runtime rate %d\n",
+			cur_rate, rate);
 	}
 
 	/* Some devices doesn't respond to sample rate changes while the