The use of madera_ohm_to_hohm was causing an error code to be lost when
passed to the .reading function.
Change-Id: Ie1741b47fb7491ba33d1dd5f9580dc975c130d9b
Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
if (ret == -EAGAIN)
goto out;
- dev_dbg(info->dev, "Mic impedance %d ohms\n", ret);
+ if (ret >= 0) {
+ dev_dbg(info->dev, "Mic impedance %d ohms\n", ret);
+ ret = madera_ohm_to_hohm((unsigned int)ret);
+ }
- madera_jds_reading(info, madera_ohm_to_hohm((unsigned int)ret));
+ madera_jds_reading(info, ret);
out:
madera_jds_start_timeout(info);