ALSA: core: Use standard printk helpers
Use dev_err() & co as much as possible. If not available (no device
assigned at the calling point), use pr_xxx() helpers instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/core/device.c b/sound/core/device.c
index df88def..ad9869d 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -50,7 +50,7 @@
return -ENXIO;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
- snd_printk(KERN_ERR "Cannot allocate device\n");
+ dev_err(card->dev, "Cannot allocate device, type=%d\n", type);
return -ENOMEM;
}
dev->card = card;
@@ -90,17 +90,17 @@
if (dev->state == SNDRV_DEV_REGISTERED &&
dev->ops->dev_disconnect)
if (dev->ops->dev_disconnect(dev))
- snd_printk(KERN_ERR
- "device disconnect failure\n");
+ dev_err(card->dev,
+ "device disconnect failure\n");
if (dev->ops->dev_free) {
if (dev->ops->dev_free(dev))
- snd_printk(KERN_ERR "device free failure\n");
+ dev_err(card->dev, "device free failure\n");
}
kfree(dev);
return 0;
}
- snd_printd("device free %p (from %pF), not found\n", device_data,
- __builtin_return_address(0));
+ dev_dbg(card->dev, "device free %p (from %pF), not found\n",
+ device_data, __builtin_return_address(0));
return -ENXIO;
}
@@ -131,13 +131,14 @@
if (dev->state == SNDRV_DEV_REGISTERED &&
dev->ops->dev_disconnect) {
if (dev->ops->dev_disconnect(dev))
- snd_printk(KERN_ERR "device disconnect failure\n");
+ dev_err(card->dev,
+ "device disconnect failure\n");
dev->state = SNDRV_DEV_DISCONNECTED;
}
return 0;
}
- snd_printd("device disconnect %p (from %pF), not found\n", device_data,
- __builtin_return_address(0));
+ dev_dbg(card->dev, "device disconnect %p (from %pF), not found\n",
+ device_data, __builtin_return_address(0));
return -ENXIO;
}
@@ -170,7 +171,7 @@
dev->state = SNDRV_DEV_REGISTERED;
return 0;
}
- snd_printd("snd_device_register busy\n");
+ dev_dbg(card->dev, "snd_device_register busy\n");
return -EBUSY;
}
snd_BUG();