ALSA: opl4: Use standard print API
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Aug 2024 13:33:57 +0000 (15:33 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 Aug 2024 05:47:23 +0000 (07:47 +0200)
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.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807133452.9424-8-tiwai@suse.de
sound/drivers/opl4/opl4_lib.c
sound/drivers/opl4/yrw801.c

index 035645eb5e8d3b7145e033c363a6b6c6a86f0f34..8fa61596875a5e4d8a92cf23b86213c0b14ecf96 100644 (file)
@@ -114,7 +114,7 @@ static int snd_opl4_detect(struct snd_opl4 *opl4)
        snd_opl4_enable_opl4(opl4);
 
        id1 = snd_opl4_read(opl4, OPL4_REG_MEMORY_CONFIGURATION);
-       snd_printdd("OPL4[02]=%02x\n", id1);
+       dev_dbg(opl4->card->dev, "OPL4[02]=%02x\n", id1);
        switch (id1 & OPL4_DEVICE_ID_MASK) {
        case 0x20:
                opl4->hardware = OPL3_HW_OPL4;
@@ -130,7 +130,7 @@ static int snd_opl4_detect(struct snd_opl4 *opl4)
        snd_opl4_write(opl4, OPL4_REG_MIX_CONTROL_PCM, 0xff);
        id1 = snd_opl4_read(opl4, OPL4_REG_MIX_CONTROL_FM);
        id2 = snd_opl4_read(opl4, OPL4_REG_MIX_CONTROL_PCM);
-       snd_printdd("OPL4 id1=%02x id2=%02x\n", id1, id2);
+       dev_dbg(opl4->card->dev, "OPL4 id1=%02x id2=%02x\n", id1, id2);
                if (id1 != 0x00 || id2 != 0xff)
                return -ENODEV;
 
@@ -200,7 +200,7 @@ int snd_opl4_create(struct snd_card *card,
        opl4->res_fm_port = request_region(fm_port, 8, "OPL4 FM");
        opl4->res_pcm_port = request_region(pcm_port, 8, "OPL4 PCM/MIX");
        if (!opl4->res_fm_port || !opl4->res_pcm_port) {
-               snd_printk(KERN_ERR "opl4: can't grab ports 0x%lx, 0x%lx\n", fm_port, pcm_port);
+               dev_err(card->dev, "opl4: can't grab ports 0x%lx, 0x%lx\n", fm_port, pcm_port);
                snd_opl4_free(opl4);
                return -EBUSY;
        }
@@ -214,7 +214,7 @@ int snd_opl4_create(struct snd_card *card,
        err = snd_opl4_detect(opl4);
        if (err < 0) {
                snd_opl4_free(opl4);
-               snd_printd("OPL4 chip not detected at %#lx/%#lx\n", fm_port, pcm_port);
+               dev_dbg(card->dev, "OPL4 chip not detected at %#lx/%#lx\n", fm_port, pcm_port);
                return err;
        }
 
index 6c335492d082e464959bc5c38a9b57ca19cf4e14..9e464b84b9053f9b1b587bdd29aa77586e2482e4 100644 (file)
@@ -43,7 +43,7 @@ int snd_yrw801_detect(struct snd_opl4 *opl4)
        snd_opl4_read_memory(opl4, buf, 0x1ffffe, 2);
        if (buf[0] != 0x01)
                return -ENODEV;
-       snd_printdd("YRW801 ROM version %02x.%02x\n", buf[0], buf[1]);
+       dev_dbg(opl4->card->dev, "YRW801 ROM version %02x.%02x\n", buf[0], buf[1]);
        return 0;
 }