ALSA: als100: Use standard print API

Use the standard print API with dev_*() instead of the old house-baked
one.  It gives better information and allows dynamically control of
debug prints.

Use the standard print API instead of open-coded printk().

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-20-tiwai@suse.de
This commit is contained in:
Takashi Iwai 2024-08-07 15:34:09 +02:00
parent 20869176d7
commit 2508acd403

View file

@ -23,8 +23,6 @@
#include <sound/opl3.h> #include <sound/opl3.h>
#include <sound/sb.h> #include <sound/sb.h>
#define PFX "als100: "
MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0"); MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0");
MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
@ -112,7 +110,7 @@ static int snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n"); dev_err(&pdev->dev, "AUDIO pnp configure failure\n");
return err; return err;
} }
port[dev] = pnp_port_start(pdev, 0); port[dev] = pnp_port_start(pdev, 0);
@ -135,7 +133,7 @@ static int snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
__mpu_error: __mpu_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
snd_printk(KERN_ERR PFX "MPU401 pnp configure failure, skipping\n"); dev_err(&pdev->dev, "MPU401 pnp configure failure, skipping\n");
} }
acard->devmpu = NULL; acard->devmpu = NULL;
mpu_port[dev] = -1; mpu_port[dev] = -1;
@ -151,7 +149,7 @@ static int snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
__fm_error: __fm_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
snd_printk(KERN_ERR PFX "OPL3 pnp configure failure, skipping\n"); dev_err(&pdev->dev, "OPL3 pnp configure failure, skipping\n");
} }
acard->devopl = NULL; acard->devopl = NULL;
fm_port[dev] = -1; fm_port[dev] = -1;
@ -230,14 +228,14 @@ static int snd_card_als100_probe(int dev,
mpu_port[dev], 0, mpu_port[dev], 0,
mpu_irq[dev], mpu_irq[dev],
NULL) < 0) NULL) < 0)
snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]); dev_err(card->dev, "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
} }
if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) { if (fm_port[dev] > 0 && fm_port[dev] != SNDRV_AUTO_PORT) {
if (snd_opl3_create(card, if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2, fm_port[dev], fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) { OPL3_HW_AUTO, 0, &opl3) < 0) {
snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n", dev_err(card->dev, "no OPL device at 0x%lx-0x%lx\n",
fm_port[dev], fm_port[dev] + 2); fm_port[dev], fm_port[dev] + 2);
} else { } else {
error = snd_opl3_timer_new(opl3, 0, 1); error = snd_opl3_timer_new(opl3, 0, 1);
@ -324,7 +322,7 @@ static int __init alsa_card_als100_init(void)
if (!als100_devices) { if (!als100_devices) {
pnp_unregister_card_driver(&als100_pnpc_driver); pnp_unregister_card_driver(&als100_pnpc_driver);
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "no Avance Logic based soundcards found\n"); pr_err("no Avance Logic based soundcards found\n");
#endif #endif
return -ENODEV; return -ENODEV;
} }