lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240824055047.1706392-16-dmitry.torokhov@gmail.com>
Date: Fri, 23 Aug 2024 22:50:39 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Heiko Stübner <heiko@...ech.de>,
	linux-input@...r.kernel.org
Cc: Andreas Kemnade <andreas@...nade.info>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 15/18] Input: zforce_ts - switch to using devm_regulator_get_enable()

The driver does not actively manage regulator state past probe() time,
so we can use devm_regulator_get_enable() to simplify the code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
---
 drivers/input/touchscreen/zforce_ts.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index c6b506a01b2a..316901c751c0 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -107,8 +107,6 @@ struct zforce_ts {
 	struct touchscreen_properties prop;
 	char			phys[32];
 
-	struct regulator	*reg_vdd;
-
 	struct gpio_desc	*gpio_int;
 	struct gpio_desc	*gpio_rst;
 
@@ -675,11 +673,7 @@ static void zforce_reset(void *data)
 	struct zforce_ts *ts = data;
 
 	zforce_reset_assert(ts);
-
 	udelay(10);
-
-	if (!IS_ERR(ts->reg_vdd))
-		regulator_disable(ts->reg_vdd);
 }
 
 static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts)
@@ -742,16 +736,11 @@ static int zforce_probe(struct i2c_client *client)
 					     "failed to request reset GPIO\n");
 	}
 
-	ts->reg_vdd = devm_regulator_get(&client->dev, "vdd");
-	error = PTR_ERR_OR_ZERO(ts->gpio_rst);
+	error = devm_regulator_get_enable(&client->dev, "vdd");
 	if (error)
 		return dev_err_probe(&client->dev, error,
 				     "failed to request vdd supply\n");
 
-	error = regulator_enable(ts->reg_vdd);
-	if (error)
-		return error;
-
 	/*
 	 * According to datasheet add 100us grace time after regular
 	 * regulator enable delay.
-- 
2.46.0.295.g3b9ea8a38a-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ