mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
audio: fix errors of coverity [1/1]
PD#166793 Problem: coverity check errors of format Solution: fix err Verify: verify locally Change-Id: Ie3a404fe50c5bdaa6a9cf4a4194659502defdbd2 Signed-off-by: jiejing.wang <jiejing.wang@amlogic.com>
This commit is contained in:
committed by
Jianxin Pan
parent
02659fa288
commit
0ca0145bd0
@@ -29,7 +29,7 @@ static void __iomem *aml_snd_reg_map[IO_MAX];
|
||||
|
||||
static int aml_snd_read(u32 base_type, unsigned int reg, unsigned int *val)
|
||||
{
|
||||
if ((base_type >= IO_PDM_BUS) && (base_type < IO_MAX)) {
|
||||
if (base_type < IO_MAX) {
|
||||
*val = readl((aml_snd_reg_map[base_type] + (reg << 2)));
|
||||
|
||||
return 0;
|
||||
@@ -41,7 +41,7 @@ static int aml_snd_read(u32 base_type, unsigned int reg, unsigned int *val)
|
||||
static void aml_snd_write(u32 base_type, unsigned int reg, unsigned int val)
|
||||
{
|
||||
|
||||
if ((base_type >= IO_PDM_BUS) && (base_type < IO_MAX)) {
|
||||
if (base_type < IO_MAX) {
|
||||
writel(val, (aml_snd_reg_map[base_type] + (reg << 2)));
|
||||
|
||||
return;
|
||||
@@ -54,15 +54,16 @@ static void aml_snd_update_bits(u32 base_type,
|
||||
unsigned int reg, unsigned int mask,
|
||||
unsigned int val)
|
||||
{
|
||||
if ((base_type >= IO_PDM_BUS) && (base_type < IO_MAX)) {
|
||||
if (base_type < IO_MAX) {
|
||||
unsigned int tmp, orig;
|
||||
|
||||
aml_snd_read(base_type, reg, &orig);
|
||||
tmp = orig & ~mask;
|
||||
tmp |= val & mask;
|
||||
aml_snd_write(base_type, reg, tmp);
|
||||
if (aml_snd_read(base_type, reg, &orig) == 0) {
|
||||
tmp = orig & ~mask;
|
||||
tmp |= val & mask;
|
||||
aml_snd_write(base_type, reg, tmp);
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pr_err("write snd reg %x error\n", reg);
|
||||
|
||||
|
||||
@@ -683,19 +683,19 @@ static int aml_card_dais_parse_of(struct snd_soc_card *card)
|
||||
init = NULL;
|
||||
/* CPU sub-node */
|
||||
cpu_node = of_parse_phandle(np, "cpu_list", i);
|
||||
if (cpu_node < 0) {
|
||||
if (!cpu_node) {
|
||||
dev_err(dev, "parse aml sound card cpu list error\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
/* CODEC sub-node */
|
||||
codec_node = of_parse_phandle(np, "codec_list", i);
|
||||
if (codec_node < 0) {
|
||||
if (!codec_node) {
|
||||
dev_err(dev, "parse aml sound card codec list error\n");
|
||||
return ret;
|
||||
}
|
||||
/* Platform sub-node */
|
||||
plat_node = of_parse_phandle(np, "plat_list", i);
|
||||
if (plat_node < 0) {
|
||||
if (!plat_node) {
|
||||
dev_err(dev,
|
||||
"parse aml sound card platform list error\n");
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user