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]
Date:   Fri, 24 May 2019 18:02:47 +0800
From:   Axel Lin <axel.lin@...ics.com>
To:     Mark Brown <broonie@...nel.org>
Cc:     Eric Jeong <eric.jeong.opensource@...semi.com>,
        Support Opensource <support.opensource@...semi.com>,
        Liam Girdwood <lgirdwood@...il.com>,
        linux-kernel@...r.kernel.org, Axel Lin <axel.lin@...ics.com>
Subject: [PATCH 2/2] regulator: slg51000: Remove unneeded regl_pdata from struct slg51000

Just use a local variable *ena_gpiod in slg51000_of_parse_cb instead.
With this change, the struct slg51000_pdata can be removed.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/regulator/slg51000-regulator.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/slg51000-regulator.c b/drivers/regulator/slg51000-regulator.c
index a06a18f220e0..04b732991d69 100644
--- a/drivers/regulator/slg51000-regulator.c
+++ b/drivers/regulator/slg51000-regulator.c
@@ -35,14 +35,9 @@ enum slg51000_regulators {
 	SLG51000_MAX_REGULATORS,
 };
 
-struct slg51000_pdata {
-	struct gpio_desc *ena_gpiod;
-};
-
 struct slg51000 {
 	struct device *dev;
 	struct regmap *regmap;
-	struct slg51000_pdata regl_pdata[SLG51000_MAX_REGULATORS];
 	struct regulator_desc *rdesc[SLG51000_MAX_REGULATORS];
 	struct regulator_dev *rdev[SLG51000_MAX_REGULATORS];
 	struct gpio_desc *cs_gpiod;
@@ -204,14 +199,14 @@ static int slg51000_of_parse_cb(struct device_node *np,
 				struct regulator_config *config)
 {
 	struct slg51000 *chip = config->driver_data;
-	struct slg51000_pdata *rpdata = &chip->regl_pdata[desc->id];
+	struct gpio_desc *ena_gpiod;
 	enum gpiod_flags gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
 
-	rpdata->ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
-							"enable-gpios", 0,
-							gflags, "gpio-en-ldo");
-	if (rpdata->ena_gpiod) {
-		config->ena_gpiod = rpdata->ena_gpiod;
+	ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
+						"enable-gpios", 0,
+						gflags, "gpio-en-ldo");
+	if (ena_gpiod) {
+		config->ena_gpiod = ena_gpiod;
 		devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
 	}
 
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ