Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157757
b: refs/heads/master
c: 35ebf6e
h: refs/heads/master
i:
  157755: 3d0aa48
v: v3
  • Loading branch information
Takashi Iwai committed Jul 22, 2009
1 parent d416b1b commit dfdbaa3
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 102 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 89e1b9511fc7fbfac4139fca5531f5f9d946c537
refs/heads/master: 35ebf6e7210dc0f7c612856513a8489a1da9de7e
20 changes: 10 additions & 10 deletions trunk/sound/pci/ctxfi/ctamixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static int amixer_set_input(struct amixer *amixer, struct rsc *rsc)
hw = amixer->rsc.hw;
hw->amixer_set_mode(amixer->rsc.ctrl_blk, AMIXER_Y_IMMEDIATE);
amixer->input = rsc;
if (NULL == rsc)
if (!rsc)
hw->amixer_set_x(amixer->rsc.ctrl_blk, BLANK_SLOT);
else
hw->amixer_set_x(amixer->rsc.ctrl_blk,
Expand Down Expand Up @@ -99,7 +99,7 @@ static int amixer_set_sum(struct amixer *amixer, struct sum *sum)

hw = amixer->rsc.hw;
amixer->sum = sum;
if (NULL == sum) {
if (!sum) {
hw->amixer_set_se(amixer->rsc.ctrl_blk, 0);
} else {
hw->amixer_set_se(amixer->rsc.ctrl_blk, 1);
Expand All @@ -124,20 +124,20 @@ static int amixer_commit_write(struct amixer *amixer)

/* Program master and conjugate resources */
amixer->rsc.ops->master(&amixer->rsc);
if (NULL != input)
if (input)
input->ops->master(input);

if (NULL != sum)
if (sum)
sum->rsc.ops->master(&sum->rsc);

for (i = 0; i < amixer->rsc.msr; i++) {
hw->amixer_set_dirty_all(amixer->rsc.ctrl_blk);
if (NULL != input) {
if (input) {
hw->amixer_set_x(amixer->rsc.ctrl_blk,
input->ops->output_slot(input));
input->ops->next_conj(input);
}
if (NULL != sum) {
if (sum) {
hw->amixer_set_sadr(amixer->rsc.ctrl_blk,
sum->rsc.ops->index(&sum->rsc));
sum->rsc.ops->next_conj(&sum->rsc);
Expand All @@ -147,10 +147,10 @@ static int amixer_commit_write(struct amixer *amixer)
amixer->rsc.ops->next_conj(&amixer->rsc);
}
amixer->rsc.ops->master(&amixer->rsc);
if (NULL != input)
if (input)
input->ops->master(input);

if (NULL != sum)
if (sum)
sum->rsc.ops->master(&sum->rsc);

return 0;
Expand Down Expand Up @@ -303,7 +303,7 @@ int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr)

*ramixer_mgr = NULL;
amixer_mgr = kzalloc(sizeof(*amixer_mgr), GFP_KERNEL);
if (NULL == amixer_mgr)
if (!amixer_mgr)
return -ENOMEM;

err = rsc_mgr_init(&amixer_mgr->mgr, AMIXER, AMIXER_RESOURCE_NUM, hw);
Expand Down Expand Up @@ -456,7 +456,7 @@ int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr)

*rsum_mgr = NULL;
sum_mgr = kzalloc(sizeof(*sum_mgr), GFP_KERNEL);
if (NULL == sum_mgr)
if (!sum_mgr)
return -ENOMEM;

err = rsc_mgr_init(&sum_mgr->mgr, SUM, SUM_RESOURCE_NUM, hw);
Expand Down
77 changes: 38 additions & 39 deletions trunk/sound/pci/ctxfi/ctatc.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ static int ct_map_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
struct snd_pcm_runtime *runtime;
struct ct_vm *vm;

if (NULL == apcm->substream)
if (!apcm->substream)
return 0;

runtime = apcm->substream->runtime;
vm = atc->vm;

apcm->vm_block = vm->map(vm, apcm->substream, runtime->dma_bytes);

if (NULL == apcm->vm_block)
if (!apcm->vm_block)
return -ENOENT;

return 0;
Expand All @@ -154,7 +154,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
{
struct ct_vm *vm;

if (NULL == apcm->vm_block)
if (!apcm->vm_block)
return;

vm = atc->vm;
Expand Down Expand Up @@ -231,16 +231,16 @@ atc_get_pitch(unsigned int input_rate, unsigned int output_rate)

static int select_rom(unsigned int pitch)
{
if ((pitch > 0x00428f5c) && (pitch < 0x01b851ec)) {
if (pitch > 0x00428f5c && pitch < 0x01b851ec) {
/* 0.26 <= pitch <= 1.72 */
return 1;
} else if ((0x01d66666 == pitch) || (0x01d66667 == pitch)) {
} else if (pitch == 0x01d66666 || pitch == 0x01d66667) {
/* pitch == 1.8375 */
return 2;
} else if (0x02000000 == pitch) {
} else if (pitch == 0x02000000) {
/* pitch == 2 */
return 3;
} else if ((pitch >= 0x0) && (pitch <= 0x08000000)) {
} else if (pitch >= 0x0 && pitch <= 0x08000000) {
/* 0 <= pitch <= 8 */
return 0;
} else {
Expand Down Expand Up @@ -283,7 +283,7 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
/* Get AMIXER resource */
n_amixer = (n_amixer < 2) ? 2 : n_amixer;
apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
if (NULL == apcm->amixers) {
if (!apcm->amixers) {
err = -ENOMEM;
goto error1;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
INIT_VOL, atc->pcm[i+device*2]);
mutex_unlock(&atc->atc_mutex);
src = src->ops->next_interleave(src);
if (NULL == src)
if (!src)
src = apcm->src;
}

Expand All @@ -334,7 +334,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
struct srcimp *srcimp;
int i;

if (NULL != apcm->srcimps) {
if (apcm->srcimps) {
for (i = 0; i < apcm->n_srcimp; i++) {
srcimp = apcm->srcimps[i];
srcimp->ops->unmap(srcimp);
Expand All @@ -345,7 +345,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
apcm->srcimps = NULL;
}

if (NULL != apcm->srccs) {
if (apcm->srccs) {
for (i = 0; i < apcm->n_srcc; i++) {
src_mgr->put_src(src_mgr, apcm->srccs[i]);
apcm->srccs[i] = NULL;
Expand All @@ -354,7 +354,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
apcm->srccs = NULL;
}

if (NULL != apcm->amixers) {
if (apcm->amixers) {
for (i = 0; i < apcm->n_amixer; i++) {
amixer_mgr->put_amixer(amixer_mgr, apcm->amixers[i]);
apcm->amixers[i] = NULL;
Expand All @@ -363,17 +363,17 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
apcm->amixers = NULL;
}

if (NULL != apcm->mono) {
if (apcm->mono) {
sum_mgr->put_sum(sum_mgr, apcm->mono);
apcm->mono = NULL;
}

if (NULL != apcm->src) {
if (apcm->src) {
src_mgr->put_src(src_mgr, apcm->src);
apcm->src = NULL;
}

if (NULL != apcm->vm_block) {
if (apcm->vm_block) {
/* Undo device virtual mem map */
ct_unmap_audio_buffer(atc, apcm);
apcm->vm_block = NULL;
Expand Down Expand Up @@ -419,7 +419,7 @@ static int atc_pcm_stop(struct ct_atc *atc, struct ct_atc_pcm *apcm)
src->ops->set_state(src, SRC_STATE_OFF);
src->ops->commit_write(src);

if (NULL != apcm->srccs) {
if (apcm->srccs) {
for (i = 0; i < apcm->n_srcc; i++) {
src = apcm->srccs[i];
src->ops->set_bm(src, 0);
Expand Down Expand Up @@ -544,18 +544,18 @@ atc_pcm_capture_get_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)

if (n_srcc) {
apcm->srccs = kzalloc(sizeof(void *)*n_srcc, GFP_KERNEL);
if (NULL == apcm->srccs)
if (!apcm->srccs)
return -ENOMEM;
}
if (n_amixer) {
apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
if (NULL == apcm->amixers) {
if (!apcm->amixers) {
err = -ENOMEM;
goto error1;
}
}
apcm->srcimps = kzalloc(sizeof(void *)*n_srcimp, GFP_KERNEL);
if (NULL == apcm->srcimps) {
if (!apcm->srcimps) {
err = -ENOMEM;
goto error1;
}
Expand Down Expand Up @@ -818,7 +818,7 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc,
/* Get AMIXER resource */
n_amixer = (n_amixer < 2) ? 2 : n_amixer;
apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
if (NULL == apcm->amixers) {
if (!apcm->amixers) {
err = -ENOMEM;
goto error1;
}
Expand Down Expand Up @@ -919,7 +919,7 @@ spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
amixer = apcm->amixers[i];
amixer->ops->setup(amixer, &src->rsc, INIT_VOL, NULL);
src = src->ops->next_interleave(src);
if (NULL == src)
if (!src)
src = apcm->src;
}
/* Connect to SPDIFOO */
Expand Down Expand Up @@ -1121,7 +1121,7 @@ static int atc_release_resources(struct ct_atc *atc)
struct ct_mixer *mixer = NULL;

/* disconnect internal mixer objects */
if (NULL != atc->mixer) {
if (atc->mixer) {
mixer = atc->mixer;
mixer->set_input_left(mixer, MIX_LINE_IN, NULL);
mixer->set_input_right(mixer, MIX_LINE_IN, NULL);
Expand All @@ -1131,7 +1131,7 @@ static int atc_release_resources(struct ct_atc *atc)
mixer->set_input_right(mixer, MIX_SPDIF_IN, NULL);
}

if (NULL != atc->daios) {
if (atc->daios) {
daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
for (i = 0; i < atc->n_daio; i++) {
daio = atc->daios[i];
Expand All @@ -1149,7 +1149,7 @@ static int atc_release_resources(struct ct_atc *atc)
atc->daios = NULL;
}

if (NULL != atc->pcm) {
if (atc->pcm) {
sum_mgr = atc->rsc_mgrs[SUM];
for (i = 0; i < atc->n_pcm; i++)
sum_mgr->put_sum(sum_mgr, atc->pcm[i]);
Expand All @@ -1158,7 +1158,7 @@ static int atc_release_resources(struct ct_atc *atc)
atc->pcm = NULL;
}

if (NULL != atc->srcs) {
if (atc->srcs) {
src_mgr = atc->rsc_mgrs[SRC];
for (i = 0; i < atc->n_src; i++)
src_mgr->put_src(src_mgr, atc->srcs[i]);
Expand All @@ -1167,7 +1167,7 @@ static int atc_release_resources(struct ct_atc *atc)
atc->srcs = NULL;
}

if (NULL != atc->srcimps) {
if (atc->srcimps) {
srcimp_mgr = atc->rsc_mgrs[SRCIMP];
for (i = 0; i < atc->n_srcimp; i++) {
srcimp = atc->srcimps[i];
Expand All @@ -1185,7 +1185,7 @@ static int ct_atc_destroy(struct ct_atc *atc)
{
int i = 0;

if (NULL == atc)
if (!atc)
return 0;

if (atc->timer) {
Expand All @@ -1196,21 +1196,20 @@ static int ct_atc_destroy(struct ct_atc *atc)
atc_release_resources(atc);

/* Destroy internal mixer objects */
if (NULL != atc->mixer)
if (atc->mixer)
ct_mixer_destroy(atc->mixer);

for (i = 0; i < NUM_RSCTYP; i++) {
if ((NULL != rsc_mgr_funcs[i].destroy) &&
(NULL != atc->rsc_mgrs[i]))
if (rsc_mgr_funcs[i].destroy && atc->rsc_mgrs[i])
rsc_mgr_funcs[i].destroy(atc->rsc_mgrs[i]);

}

if (NULL != atc->hw)
if (atc->hw)
destroy_hw_obj((struct hw *)atc->hw);

/* Destroy device virtual memory manager object */
if (NULL != atc->vm) {
if (atc->vm) {
ct_vm_destroy(atc->vm);
atc->vm = NULL;
}
Expand Down Expand Up @@ -1275,7 +1274,7 @@ int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc)
alsa_dev_funcs[MIXER].public_name = atc->chip_name;

for (i = 0; i < NUM_CTALSADEVS; i++) {
if (NULL == alsa_dev_funcs[i].create)
if (!alsa_dev_funcs[i].create)
continue;

err = alsa_dev_funcs[i].create(atc, i,
Expand Down Expand Up @@ -1312,7 +1311,7 @@ static int __devinit atc_create_hw_devs(struct ct_atc *atc)
return err;

for (i = 0; i < NUM_RSCTYP; i++) {
if (NULL == rsc_mgr_funcs[i].create)
if (!rsc_mgr_funcs[i].create)
continue;

err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]);
Expand All @@ -1339,19 +1338,19 @@ static int atc_get_resources(struct ct_atc *atc)
int err, i;

atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL);
if (NULL == atc->daios)
if (!atc->daios)
return -ENOMEM;

atc->srcs = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL);
if (NULL == atc->srcs)
if (!atc->srcs)
return -ENOMEM;

atc->srcimps = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL);
if (NULL == atc->srcimps)
if (!atc->srcimps)
return -ENOMEM;

atc->pcm = kzalloc(sizeof(void *)*(2*4), GFP_KERNEL);
if (NULL == atc->pcm)
if (!atc->pcm)
return -ENOMEM;

daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
Expand Down Expand Up @@ -1648,7 +1647,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
*ratc = NULL;

atc = kzalloc(sizeof(*atc), GFP_KERNEL);
if (NULL == atc)
if (!atc)
return -ENOMEM;

/* Set operations */
Expand Down
Loading

0 comments on commit dfdbaa3

Please sign in to comment.