Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92ac2166 authored by Maria Yu's avatar Maria Yu
Browse files

hwmon: qpnp-adc: Correct the return value when failed init thermal



The return value of qpnp_vadc_init_thermal was never updated
even if it is failed thermal zone sensor register. Correct
this by update the rc value when there is err.

Change-Id: I8ccf858c06f6ac8659f1bac5fa1dff7f357d4f3a
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 436b6888
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2618,6 +2618,7 @@ static int32_t qpnp_vadc_init_thermal(struct qpnp_vadc_chip *vadc,
				&qpnp_vadc_thermal_ops);
			if (IS_ERR(vadc->vadc_therm_chan[i].tz_dev)) {
				pr_err("thermal device register failed.\n");
				rc = PTR_ERR(vadc->vadc_therm_chan[i].tz_dev);
				goto thermal_err_sens;
			}
		}