From 60c5772b50fe8ce947685cfe3a80b9bf6ea92831 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 29 Jan 2014 14:20:19 +0100 Subject: ALSA: pci: Convert to snd_card_new() with a device pointer Also remove superfluous snd_card_set_dev() calls. Signed-off-by: Takashi Iwai --- sound/pci/als4000.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/pci/als4000.c') diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index ffc821b0139..2b2bb0fa3bc 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c @@ -888,9 +888,9 @@ static int snd_card_als4000_probe(struct pci_dev *pci, pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO); pci_set_master(pci); - err = snd_card_create(index[dev], id[dev], THIS_MODULE, - sizeof(*acard) /* private_data: acard */, - &card); + err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, + sizeof(*acard) /* private_data: acard */, + &card); if (err < 0) { pci_release_regions(pci); pci_disable_device(pci); @@ -920,7 +920,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci, chip->pci = pci; chip->alt_port = iobase; - snd_card_set_dev(card, &pci->dev); snd_als4000_configure(chip); -- cgit v1.2.3-70-g09d2 From d85d878efb304779205beb951a5d87eb8018b6d8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 25 Feb 2014 12:51:05 +0100 Subject: ALSA: als4000: Use standard printk helpers Convert with dev_err() and co from snd_printk(), etc. Signed-off-by: Takashi Iwai --- sound/pci/als4000.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'sound/pci/als4000.c') diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 2b2bb0fa3bc..b751c381d25 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c @@ -578,7 +578,7 @@ static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id) snd_als4k_iobase_readb(chip->alt_port, ALS4K_IOB_16_ACK_FOR_CR1E); - /* printk(KERN_INFO "als4000: irq 0x%04x 0x%04x\n", + /* dev_dbg(chip->card->dev, "als4000: irq 0x%04x 0x%04x\n", pci_irqstatus, sb_irqstatus); */ /* only ack the things we actually handled above */ @@ -791,13 +791,13 @@ static int snd_als4000_create_gameport(struct snd_card_als4000 *acard, int dev) } if (!r) { - printk(KERN_WARNING "als4000: cannot reserve joystick ports\n"); + dev_warn(&acard->pci->dev, "cannot reserve joystick ports\n"); return -EBUSY; } acard->gameport = gp = gameport_allocate_port(); if (!gp) { - printk(KERN_ERR "als4000: cannot allocate memory for gameport\n"); + dev_err(&acard->pci->dev, "cannot allocate memory for gameport\n"); release_and_free_resource(r); return -ENOMEM; } @@ -873,7 +873,7 @@ static int snd_card_als4000_probe(struct pci_dev *pci, /* check, if we can restrict PCI DMA transfers to 24 bits */ if (pci_set_dma_mask(pci, DMA_BIT_MASK(24)) < 0 || pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(24)) < 0) { - snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); + dev_err(&pci->dev, "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; } @@ -933,7 +933,7 @@ static int snd_card_als4000_probe(struct pci_dev *pci, MPU401_INFO_INTEGRATED | MPU401_INFO_IRQ_HOOK, -1, &chip->rmidi)) < 0) { - printk(KERN_ERR "als4000: no MPU-401 device at 0x%lx?\n", + dev_err(&pci->dev, "no MPU-401 device at 0x%lx?\n", iobase + ALS4K_IOB_30_MIDI_DATA); goto out_err; } @@ -954,7 +954,7 @@ static int snd_card_als4000_probe(struct pci_dev *pci, iobase + ALS4K_IOB_10_ADLIB_ADDR0, iobase + ALS4K_IOB_12_ADLIB_ADDR2, OPL3_HW_AUTO, 1, &opl3) < 0) { - printk(KERN_ERR "als4000: no OPL device at 0x%lx-0x%lx?\n", + dev_err(&pci->dev, "no OPL device at 0x%lx-0x%lx?\n", iobase + ALS4K_IOB_10_ADLIB_ADDR0, iobase + ALS4K_IOB_12_ADLIB_ADDR2); } else { @@ -1014,8 +1014,7 @@ static int snd_als4000_resume(struct device *dev) pci_set_power_state(pci, PCI_D0); pci_restore_state(pci); if (pci_enable_device(pci) < 0) { - printk(KERN_ERR "als4000: pci_enable_device failed, " - "disabling device\n"); + dev_err(dev, "pci_enable_device failed, disabling device\n"); snd_card_disconnect(card); return -EIO; } -- cgit v1.2.3-70-g09d2