X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=sound%2Fpci%2Fals300.c;h=d7653cb7ac60dc24f5d3e07ff1537f18a32e1299;hb=b2e75eff5e859d0c294e7405958362b26a423c6e;hp=9f406fbe0d9568e80cf691a8583f597419501fef;hpb=437a5a4606c12ab904793a7cad5b2062fc76c04e;p=safe%2Fjmp%2Flinux-2.6 diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 9f406fb..d7653cb 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -30,7 +30,6 @@ * to keep track of what period we are in. */ -#include #include #include #include @@ -88,13 +87,13 @@ #define PLAYBACK_BLOCK_COUNTER 0x9A #define RECORD_BLOCK_COUNTER 0x9B -#define DEBUG_CALLS 1 -#define DEBUG_PLAY_REC 1 +#define DEBUG_CALLS 0 +#define DEBUG_PLAY_REC 0 #if DEBUG_CALLS -#define snd_als300_dbgcalls(format, args...) printk(format, ##args) -#define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __FUNCTION__) -#define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __FUNCTION__) +#define snd_als300_dbgcalls(format, args...) printk(KERN_DEBUG format, ##args) +#define snd_als300_dbgcallenter() printk(KERN_ERR "--> %s\n", __func__) +#define snd_als300_dbgcallleave() printk(KERN_ERR "<-- %s\n", __func__) #else #define snd_als300_dbgcalls(format, args...) #define snd_als300_dbgcallenter() @@ -146,7 +145,7 @@ struct snd_als300_substream_data { int block_counter_register; }; -static struct pci_device_id snd_als300_ids[] = { +static DEFINE_PCI_DEVICE_TABLE(snd_als300_ids) = { { 0x4005, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300 }, { 0x4005, 0x0308, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DEVICE_ALS300_PLUS }, { 0, } @@ -444,7 +443,7 @@ static int snd_als300_capture_close(struct snd_pcm_substream *substream) } static int snd_als300_pcm_hw_params(struct snd_pcm_substream *substream, - snd_pcm_hw_params_t * hw_params) + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); @@ -673,7 +672,7 @@ static void snd_als300_init(struct snd_als300 *chip) snd_als300_dbgcallleave(); } -static int __devinit snd_als300_create(snd_card_t *card, +static int __devinit snd_als300_create(struct snd_card *card, struct pci_dev *pci, int chip_type, struct snd_als300 **rchip) { @@ -681,7 +680,7 @@ static int __devinit snd_als300_create(snd_card_t *card, void *irq_handler; int err; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_als300_dev_free, }; *rchip = NULL; @@ -690,8 +689,8 @@ static int __devinit snd_als300_create(snd_card_t *card, if ((err = pci_enable_device(pci)) < 0) return err; - if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 || - pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) { + if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || + pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { printk(KERN_ERR "error setting 28bit DMA mask\n"); pci_disable_device(pci); return -ENXIO; @@ -733,7 +732,8 @@ static int __devinit snd_als300_create(snd_card_t *card, snd_als300_init(chip); - if (snd_als300_ac97(chip) < 0) { + err = snd_als300_ac97(chip); + if (err < 0) { snd_printk(KERN_WARNING "Could not create ac97\n"); snd_als300_free(chip); return err; @@ -812,10 +812,10 @@ static int __devinit snd_als300_probe(struct pci_dev *pci, return -ENOENT; } - card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); + err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); - if (card == NULL) - return -ENOMEM; + if (err < 0) + return err; chip_type = pci_id->driver_data;