return r;
                cond_resched();
        }
-       snd_printk(KERN_ERR "wait src ready timeout 0x%lx [0x%x]\n",
+       dev_err(ensoniq->card->dev, "wait src ready timeout 0x%lx [0x%x]\n",
                   ES_REG(ensoniq, 1371_SMPRATE), r);
        return 0;
 }
        unsigned long end_time = jiffies + HZ / 10;
 
 #if 0
-       printk(KERN_DEBUG
+       dev_dbg(ensoniq->card->dev,
               "CODEC WRITE: reg = 0x%x, val = 0x%x (0x%x), creg = 0x%x\n",
               reg, val, ES_1370_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1370_CODEC));
 #endif
                }
                schedule_timeout_uninterruptible(1);
        } while (time_after(end_time, jiffies));
-       snd_printk(KERN_ERR "codec write timeout, status = 0x%x\n",
+       dev_err(ensoniq->card->dev, "codec write timeout, status = 0x%x\n",
                   inl(ES_REG(ensoniq, STATUS)));
 }
 
                }
        }
        mutex_unlock(&ensoniq->src_mutex);
-       snd_printk(KERN_ERR "codec write timeout at 0x%lx [0x%x]\n",
+       dev_err(ensoniq->card->dev, "codec write timeout at 0x%lx [0x%x]\n",
                   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
 }
 
                        }
                        mutex_unlock(&ensoniq->src_mutex);
                        if (++fail > 10) {
-                               snd_printk(KERN_ERR "codec read timeout (final) "
-                                          "at 0x%lx, reg = 0x%x [0x%x]\n",
+                               dev_err(ensoniq->card->dev,
+                                       "codec read timeout (final) at 0x%lx, reg = 0x%x [0x%x]\n",
                                           ES_REG(ensoniq, 1371_CODEC), reg,
                                           inl(ES_REG(ensoniq, 1371_CODEC)));
                                return 0;
                }
        }
        mutex_unlock(&ensoniq->src_mutex);
-       snd_printk(KERN_ERR "es1371: codec read timeout at 0x%lx [0x%x]\n",
+       dev_err(ensoniq->card->dev, "codec read timeout at 0x%lx [0x%x]\n",
                   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
        return 0;
 }
 #ifdef SUPPORT_JOYSTICK
 
 #ifdef CHIP1371
-static int snd_ensoniq_get_joystick_port(int dev)
+static int snd_ensoniq_get_joystick_port(struct ensoniq *ensoniq, int dev)
 {
        switch (joystick_port[dev]) {
        case 0: /* disabled */
                return joystick_port[dev];
 
        default:
-               printk(KERN_ERR "ens1371: invalid joystick port %#x", joystick_port[dev]);
+               dev_err(ensoniq->card->dev,
+                       "invalid joystick port %#x", joystick_port[dev]);
                return 0;
        }
 }
 #else
-static inline int snd_ensoniq_get_joystick_port(int dev)
+static int snd_ensoniq_get_joystick_port(struct ensoniq *ensoniq, int dev)
 {
        return joystick[dev] ? 0x200 : 0;
 }
        struct gameport *gp;
        int io_port;
 
-       io_port = snd_ensoniq_get_joystick_port(dev);
+       io_port = snd_ensoniq_get_joystick_port(ensoniq, dev);
 
        switch (io_port) {
        case 0:
                        if (request_region(io_port, 8, "ens137x: gameport"))
                                break;
                if (io_port > 0x218) {
-                       printk(KERN_WARNING "ens137x: no gameport ports available\n");
+                       dev_warn(ensoniq->card->dev,
+                                "no gameport ports available\n");
                        return -EBUSY;
                }
                break;
 
        default:
                if (!request_region(io_port, 8, "ens137x: gameport")) {
-                       printk(KERN_WARNING "ens137x: gameport io port %#x in use\n",
+                       dev_warn(ensoniq->card->dev,
+                                "gameport io port %#x in use\n",
                               io_port);
                        return -EBUSY;
                }
 
        ensoniq->gameport = gp = gameport_allocate_port();
        if (!gp) {
-               printk(KERN_ERR "ens137x: cannot allocate memory for gameport\n");
+               dev_err(ensoniq->card->dev,
+                       "cannot allocate memory for gameport\n");
                release_region(io_port, 8);
                return -ENOMEM;
        }
        pci_set_power_state(pci, PCI_D0);
        pci_restore_state(pci);
        if (pci_enable_device(pci) < 0) {
-               printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, "
-                      "disabling device\n");
+               dev_err(dev, "pci_enable_device failed, disabling device\n");
                snd_card_disconnect(card);
                return -EIO;
        }
        ensoniq->port = pci_resource_start(pci, 0);
        if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_SHARED,
                        KBUILD_MODNAME, ensoniq)) {
-               snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
+               dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
                snd_ensoniq_free(ensoniq);
                return -EBUSY;
        }
 #ifdef CHIP1370
        if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
                                16, &ensoniq->dma_bug) < 0) {
-               snd_printk(KERN_ERR "unable to allocate space for phantom area - dma_bug\n");
+               dev_err(card->dev, "unable to allocate space for phantom area - dma_bug\n");
                snd_ensoniq_free(ensoniq);
                return -EBUSY;
        }