Commit a2e7cf55 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: cs42l43: Check error from device_property_read_u32_array()

Whilst reading cirrus,buttons-ohms the error from
device_property_read_u32_array() is not checked, whilst there is a
preceding device_property_count_u32() which is checked the property
read can still fail. Add the missing check.
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://msgid.link/r/20240125103117.2622095-3-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 40f6281c
......@@ -106,8 +106,13 @@ int cs42l43_set_jack(struct snd_soc_component *component,
goto error;
}
device_property_read_u32_array(cs42l43->dev, "cirrus,buttons-ohms",
priv->buttons, ret);
ret = device_property_read_u32_array(cs42l43->dev, "cirrus,buttons-ohms",
priv->buttons, ret);
if (ret < 0) {
dev_err(priv->dev, "Property cirrus,button-ohms malformed: %d\n",
ret);
goto error;
}
} else {
priv->buttons[0] = 70;
priv->buttons[1] = 185;
......
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