Commit 99c155e8 authored by Viorel Suman's avatar Viorel Suman Committed by Greg Kroah-Hartman

ASoC: ak4458: add return value for ak4458_probe

[ Upstream commit a8dee20d ]

AK4458 is probed successfully even if AK4458 is not present - this
is caused by probe function returning no error on i2c access failure.
Return an error on probe if i2c access has failed.
Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 635bd38a
...@@ -536,9 +536,10 @@ static void ak4458_power_on(struct ak4458_priv *ak4458) ...@@ -536,9 +536,10 @@ static void ak4458_power_on(struct ak4458_priv *ak4458)
} }
} }
static void ak4458_init(struct snd_soc_component *component) static int ak4458_init(struct snd_soc_component *component)
{ {
struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
int ret;
/* External Mute ON */ /* External Mute ON */
if (ak4458->mute_gpiod) if (ak4458->mute_gpiod)
...@@ -546,21 +547,21 @@ static void ak4458_init(struct snd_soc_component *component) ...@@ -546,21 +547,21 @@ static void ak4458_init(struct snd_soc_component *component)
ak4458_power_on(ak4458); ak4458_power_on(ak4458);
snd_soc_component_update_bits(component, AK4458_00_CONTROL1, ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
0x80, 0x80); /* ACKS bit = 1; 10000000 */ 0x80, 0x80); /* ACKS bit = 1; 10000000 */
if (ret < 0)
return ret;
ak4458_rstn_control(component, 1); return ak4458_rstn_control(component, 1);
} }
static int ak4458_probe(struct snd_soc_component *component) static int ak4458_probe(struct snd_soc_component *component)
{ {
struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
ak4458_init(component);
ak4458->fs = 48000; ak4458->fs = 48000;
return 0; return ak4458_init(component);
} }
static void ak4458_remove(struct snd_soc_component *component) static void ak4458_remove(struct snd_soc_component *component)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment