From f1e72c4946ba9c61c584350373afd71a59da6730 Mon Sep 17 00:00:00 2001 From: Jishnu Prakash Date: Mon, 5 Apr 2021 15:14:12 +0530 Subject: [PATCH] regulator: rpm-smd: correct logic for min dropout voltage Correct existing logic to ensure that minimum dropout voltage does not get read in place of active/sleep set property. Change-Id: I37239e99de849a0f756eb12d0614d297cfdeacd4 Signed-off-by: Jishnu Prakash --- drivers/regulator/rpm-smd-regulator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/rpm-smd-regulator.c b/drivers/regulator/rpm-smd-regulator.c index 1806db28e196..a0c581311a47 100644 --- a/drivers/regulator/rpm-smd-regulator.c +++ b/drivers/regulator/rpm-smd-regulator.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2012-2015, 2018-2020, The Linux Foundation. All rights reserved. */ +/* Copyright (c) 2012-2015, 2018-2021, The Linux Foundation. All rights reserved. */ #define pr_fmt(fmt) "%s: " fmt, __func__ @@ -1541,14 +1541,14 @@ static int rpm_vreg_device_probe(struct platform_device *pdev) goto fail_free_reg; } + reg->set_active = !!(val & RPM_SET_CONFIG_ACTIVE); + reg->set_sleep = !!(val & RPM_SET_CONFIG_SLEEP); + rc = of_property_read_u32(node, "qcom,min-dropout-voltage", &val); if (!rc) reg->rdesc.min_dropout_uV = val; - reg->set_active = !!(val & RPM_SET_CONFIG_ACTIVE); - reg->set_sleep = !!(val & RPM_SET_CONFIG_SLEEP); - init_data = of_get_regulator_init_data(dev, node, ®->rdesc); if (init_data == NULL) { dev_err(dev, "%s: failed to populate regulator_init_data\n",