ALSA: ice1712.c: fix coding style
before: total: 113 errors, 169 warnings, 2786 lines checked total: 26 errors, 24 warnings, 504 lines checked after: total: 14 errors, 163 warnings, 2799 lines checked total: 0 errors, 24 warnings, 504 lines checked Compile tested only. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
1de9fdc24b
commit
3d8cb466a8
@ -47,7 +47,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/init.h>
|
||||
@ -273,7 +273,8 @@ static int snd_ice1712_digmix_route_ac97_put(struct snd_kcontrol *kcontrol, stru
|
||||
spin_lock_irq(&ice->reg_lock);
|
||||
val = inb(ICEMT(ice, MONITOR_ROUTECTRL));
|
||||
nval = val & ~ICE1712_ROUTE_AC97;
|
||||
if (ucontrol->value.integer.value[0]) nval |= ICE1712_ROUTE_AC97;
|
||||
if (ucontrol->value.integer.value[0])
|
||||
nval |= ICE1712_ROUTE_AC97;
|
||||
outb(nval, ICEMT(ice, MONITOR_ROUTECTRL));
|
||||
spin_unlock_irq(&ice->reg_lock);
|
||||
return val != nval;
|
||||
@ -381,9 +382,9 @@ int __devinit snd_ice1712_init_cs8427(struct snd_ice1712 *ice, int addr)
|
||||
{
|
||||
int err;
|
||||
|
||||
if ((err = snd_cs8427_create(ice->i2c, addr,
|
||||
(ice->cs8427_timeout * HZ) / 1000,
|
||||
&ice->cs8427)) < 0) {
|
||||
err = snd_cs8427_create(ice->i2c, addr,
|
||||
(ice->cs8427_timeout * HZ) / 1000, &ice->cs8427);
|
||||
if (err < 0) {
|
||||
snd_printk(KERN_ERR "CS8427 initialization failed\n");
|
||||
return err;
|
||||
}
|
||||
@ -457,11 +458,12 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id)
|
||||
u16 pbkstatus;
|
||||
struct snd_pcm_substream *substream;
|
||||
pbkstatus = inw(ICEDS(ice, INTSTAT));
|
||||
//printk("pbkstatus = 0x%x\n", pbkstatus);
|
||||
/* printk("pbkstatus = 0x%x\n", pbkstatus); */
|
||||
for (idx = 0; idx < 6; idx++) {
|
||||
if ((pbkstatus & (3 << (idx * 2))) == 0)
|
||||
continue;
|
||||
if ((substream = ice->playback_con_substream_ds[idx]) != NULL)
|
||||
substream = ice->playback_con_substream_ds[idx];
|
||||
if (substream != NULL)
|
||||
snd_pcm_period_elapsed(substream);
|
||||
outw(3 << (idx * 2), ICEDS(ice, INTSTAT));
|
||||
}
|
||||
@ -711,8 +713,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pointer(struct snd_pcm_substream *s
|
||||
return bytes_to_frames(substream->runtime, ptr);
|
||||
}
|
||||
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback =
|
||||
{
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback = {
|
||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_BLOCK_TRANSFER |
|
||||
SNDRV_PCM_INFO_MMAP_VALID |
|
||||
@ -731,8 +732,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback =
|
||||
.fifo_size = 0,
|
||||
};
|
||||
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback_ds =
|
||||
{
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback_ds = {
|
||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_BLOCK_TRANSFER |
|
||||
SNDRV_PCM_INFO_MMAP_VALID |
|
||||
@ -751,8 +751,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback_ds =
|
||||
.fifo_size = 0,
|
||||
};
|
||||
|
||||
static const struct snd_pcm_hardware snd_ice1712_capture =
|
||||
{
|
||||
static const struct snd_pcm_hardware snd_ice1712_capture = {
|
||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_BLOCK_TRANSFER |
|
||||
SNDRV_PCM_INFO_MMAP_VALID),
|
||||
@ -1123,8 +1122,7 @@ static snd_pcm_uframes_t snd_ice1712_capture_pro_pointer(struct snd_pcm_substrea
|
||||
return bytes_to_frames(substream->runtime, ptr);
|
||||
}
|
||||
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback_pro =
|
||||
{
|
||||
static const struct snd_pcm_hardware snd_ice1712_playback_pro = {
|
||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_BLOCK_TRANSFER |
|
||||
SNDRV_PCM_INFO_MMAP_VALID |
|
||||
@ -1143,8 +1141,7 @@ static const struct snd_pcm_hardware snd_ice1712_playback_pro =
|
||||
.fifo_size = 0,
|
||||
};
|
||||
|
||||
static const struct snd_pcm_hardware snd_ice1712_capture_pro =
|
||||
{
|
||||
static const struct snd_pcm_hardware snd_ice1712_capture_pro = {
|
||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
|
||||
SNDRV_PCM_INFO_BLOCK_TRANSFER |
|
||||
SNDRV_PCM_INFO_MMAP_VALID |
|
||||
@ -1272,7 +1269,8 @@ static int __devinit snd_ice1712_pcm_profi(struct snd_ice1712 * ice, int device,
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((err = snd_ice1712_build_pro_mixer(ice)) < 0)
|
||||
err = snd_ice1712_build_pro_mixer(ice);
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
@ -1510,27 +1508,32 @@ static int __devinit snd_ice1712_ac97_mixer(struct snd_ice1712 * ice)
|
||||
};
|
||||
|
||||
if (ice_has_con_ac97(ice)) {
|
||||
if ((err = snd_ac97_bus(ice->card, bus_num++, &con_ops, NULL, &pbus)) < 0)
|
||||
err = snd_ac97_bus(ice->card, bus_num++, &con_ops, NULL, &pbus);
|
||||
if (err < 0)
|
||||
return err;
|
||||
memset(&ac97, 0, sizeof(ac97));
|
||||
ac97.private_data = ice;
|
||||
ac97.private_free = snd_ice1712_mixer_free_ac97;
|
||||
if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
|
||||
err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
|
||||
if (err < 0)
|
||||
printk(KERN_WARNING "ice1712: cannot initialize ac97 for consumer, skipped\n");
|
||||
else {
|
||||
if ((err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice))) < 0)
|
||||
err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_mixer_digmix_route_ac97, ice));
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
|
||||
if ((err = snd_ac97_bus(ice->card, bus_num, &pro_ops, NULL, &pbus)) < 0)
|
||||
err = snd_ac97_bus(ice->card, bus_num, &pro_ops, NULL, &pbus);
|
||||
if (err < 0)
|
||||
return err;
|
||||
memset(&ac97, 0, sizeof(ac97));
|
||||
ac97.private_data = ice;
|
||||
ac97.private_free = snd_ice1712_mixer_free_ac97;
|
||||
if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
|
||||
err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
|
||||
if (err < 0)
|
||||
printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
|
||||
else
|
||||
return 0;
|
||||
@ -1897,7 +1900,7 @@ static int snd_ice1712_pro_internal_clock_default_info(struct snd_kcontrol *kcon
|
||||
"64000", /* 10: 15 */
|
||||
"88200", /* 11: 11 */
|
||||
"96000", /* 12: 7 */
|
||||
// "IEC958 Input", /* 13: -- */
|
||||
/* "IEC958 Input", 13: -- */
|
||||
};
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||
uinfo->count = 1;
|
||||
@ -2526,7 +2529,8 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
|
||||
*r_ice1712 = NULL;
|
||||
|
||||
/* enable PCI device */
|
||||
if ((err = pci_enable_device(pci)) < 0)
|
||||
err = pci_enable_device(pci);
|
||||
if (err < 0)
|
||||
return err;
|
||||
/* check, if we can restrict PCI DMA transfers to 28 bits */
|
||||
if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
|
||||
@ -2570,7 +2574,8 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
|
||||
snd_ice1712_proc_init(ice);
|
||||
synchronize_irq(pci->irq);
|
||||
|
||||
if ((err = pci_request_regions(pci, "ICE1712")) < 0) {
|
||||
err = pci_request_regions(pci, "ICE1712");
|
||||
if (err < 0) {
|
||||
kfree(ice);
|
||||
pci_disable_device(pci);
|
||||
return err;
|
||||
@ -2606,7 +2611,8 @@ static int __devinit snd_ice1712_create(struct snd_card *card,
|
||||
ICEREG(ice, IRQMASK));
|
||||
outb(0x00, ICEMT(ice, IRQ));
|
||||
|
||||
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops)) < 0) {
|
||||
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops);
|
||||
if (err < 0) {
|
||||
snd_ice1712_free(ice);
|
||||
return err;
|
||||
}
|
||||
@ -2649,9 +2655,9 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
strcpy(card->driver, "ICE1712");
|
||||
strcpy(card->shortname, "ICEnsemble ICE1712");
|
||||
|
||||
if ((err = snd_ice1712_create(card, pci, model[dev], omni[dev],
|
||||
cs8427_timeout[dev], dxr_enable[dev],
|
||||
&ice)) < 0) {
|
||||
err = snd_ice1712_create(card, pci, model[dev], omni[dev],
|
||||
cs8427_timeout[dev], dxr_enable[dev], &ice);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
@ -2663,7 +2669,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
if (c->driver) /* specific driver? */
|
||||
strcpy(card->driver, c->driver);
|
||||
if (c->chip_init) {
|
||||
if ((err = c->chip_init(ice)) < 0) {
|
||||
err = c->chip_init(ice);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
@ -2675,47 +2682,52 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
c = &no_matched;
|
||||
__found:
|
||||
|
||||
if ((err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL)) < 0) {
|
||||
err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (ice_has_con_ac97(ice))
|
||||
if ((err = snd_ice1712_pcm(ice, pcm_dev++, NULL)) < 0) {
|
||||
err = snd_ice1712_pcm(ice, pcm_dev++, NULL);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((err = snd_ice1712_ac97_mixer(ice)) < 0) {
|
||||
err = snd_ice1712_ac97_mixer(ice);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
if ((err = snd_ice1712_build_controls(ice)) < 0) {
|
||||
err = snd_ice1712_build_controls(ice);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (c->build_controls) {
|
||||
if ((err = c->build_controls(ice)) < 0) {
|
||||
err = c->build_controls(ice);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
if (ice_has_con_ac97(ice))
|
||||
if ((err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL)) < 0) {
|
||||
err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!c->no_mpu401) {
|
||||
if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
|
||||
err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
|
||||
ICEREG(ice, MPU1_CTRL),
|
||||
(c->mpu401_1_info_flags |
|
||||
MPU401_INFO_INTEGRATED),
|
||||
ice->irq, 0,
|
||||
&ice->rmidi[0])) < 0) {
|
||||
(c->mpu401_1_info_flags | MPU401_INFO_INTEGRATED),
|
||||
ice->irq, 0, &ice->rmidi[0]);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
@ -2727,12 +2739,12 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
|
||||
if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) {
|
||||
/* 2nd port used */
|
||||
if ((err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
|
||||
err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
|
||||
ICEREG(ice, MPU2_CTRL),
|
||||
(c->mpu401_2_info_flags |
|
||||
MPU401_INFO_INTEGRATED),
|
||||
ice->irq, 0,
|
||||
&ice->rmidi[1])) < 0) {
|
||||
(c->mpu401_2_info_flags | MPU401_INFO_INTEGRATED),
|
||||
ice->irq, 0, &ice->rmidi[1]);
|
||||
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
@ -2750,7 +2762,8 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
|
||||
sprintf(card->longname, "%s at 0x%lx, irq %i",
|
||||
card->shortname, ice->port, ice->irq);
|
||||
|
||||
if ((err = snd_card_register(card)) < 0) {
|
||||
err = snd_card_register(card);
|
||||
if (err < 0) {
|
||||
snd_card_free(card);
|
||||
return err;
|
||||
}
|
||||
|
@ -455,7 +455,7 @@ static inline int snd_ice1712_gpio_read_bits(struct snd_ice1712 *ice,
|
||||
{
|
||||
ice->gpio.direction &= ~mask;
|
||||
snd_ice1712_gpio_set_dir(ice, ice->gpio.direction);
|
||||
return (snd_ice1712_gpio_read(ice) & mask);
|
||||
return snd_ice1712_gpio_read(ice) & mask;
|
||||
}
|
||||
|
||||
int snd_ice1712_spdif_build_controls(struct snd_ice1712 *ice);
|
||||
|
Loading…
Reference in New Issue
Block a user