ASoC: msm: Fix the usage of macro IS_ERR_VALUE
Using macro IS_ERR_VALUE to check variable that is
not the type of "unsigned long" can cause compilation
warning. Correct the use of IS_ERR_VALUE by replacing
it with a simple check against negative value.
Change-Id: I6849d1b08d06630be61b07ec6feabcb94b4cf9b1
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
diff --git a/sound/soc/msm/msmfalcon-common.c b/sound/soc/msm/msmfalcon-common.c
index 59289821..fba9c28 100644
--- a/sound/soc/msm/msmfalcon-common.c
+++ b/sound/soc/msm/msmfalcon-common.c
@@ -1920,7 +1920,7 @@ int msm_aux_pcm_snd_startup(struct snd_pcm_substream *substream)
ret = -EINVAL;
}
}
- if (IS_ERR_VALUE(ret))
+ if (ret < 0)
auxpcm_intf_conf[index].ref_cnt--;
mutex_unlock(&auxpcm_intf_conf[index].lock);
@@ -2055,7 +2055,7 @@ static int msm_mi2s_set_sclk(struct snd_pcm_substream *substream, bool enable)
int index = cpu_dai->id;
port_id = msm_get_port_id(rtd->dai_link->be_id);
- if (IS_ERR_VALUE(port_id)) {
+ if (port_id < 0) {
dev_err(rtd->card->dev, "%s: Invalid port_id\n", __func__);
ret = port_id;
goto done;
@@ -2116,7 +2116,7 @@ int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
mutex_lock(&mi2s_intf_conf[index].lock);
if (++mi2s_intf_conf[index].ref_cnt == 1) {
ret = msm_mi2s_set_sclk(substream, true);
- if (IS_ERR_VALUE(ret)) {
+ if (ret < 0) {
dev_err(rtd->card->dev,
"%s: afe lpass clock failed to enable MI2S clock, err:%d\n",
__func__, ret);
@@ -2138,7 +2138,7 @@ int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
if (!mi2s_intf_conf[index].msm_is_mi2s_master)
fmt = SND_SOC_DAIFMT_CBM_CFM;
ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
- if (IS_ERR_VALUE(ret)) {
+ if (ret < 0) {
dev_err(rtd->card->dev,
"%s: set fmt cpu dai failed for MI2S (%d), err:%d\n",
__func__, index, ret);
@@ -2146,10 +2146,10 @@ int msm_mi2s_snd_startup(struct snd_pcm_substream *substream)
}
}
clk_off:
- if (IS_ERR_VALUE(ret))
+ if (ret < 0)
msm_mi2s_set_sclk(substream, false);
clean_up:
- if (IS_ERR_VALUE(ret))
+ if (ret < 0)
mi2s_intf_conf[index].ref_cnt--;
mutex_unlock(&mi2s_intf_conf[index].lock);
done: