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>] [day] [month] [year] [list]
Message-ID: <1401171246.11231.5.camel@phoenix>
Date:	Tue, 27 May 2014 14:14:06 +0800
From:	Axel Lin <axel.lin@...ics.com>
To:	Mark Brown <broonie@...nel.org>
Cc:	Robin Gong <b38343@...escale.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] regulator: pfuze100: Remove *regulators[] from struct
 pfuze_chip

This driver is using devm_regulator_register() so we don't need to save the
pointer for cleanup.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/regulator/pfuze100-regulator.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index 930eb13..c12cbdf32 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -69,7 +69,6 @@ struct pfuze_chip {
 	struct regmap *regmap;
 	struct device *dev;
 	struct pfuze_regulator regulator_descs[PFUZE100_MAX_REGULATOR];
-	struct regulator_dev *regulators[PFUZE100_MAX_REGULATOR];
 };
 
 static const int pfuze100_swbst[] = {
@@ -411,6 +410,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
 	struct pfuze_regulator_platform_data *pdata =
 	    dev_get_platdata(&client->dev);
 	struct regulator_config config = { };
+	struct regulator_dev *rdev;
 	int i, ret;
 	const struct of_device_id *match;
 	u32 regulator_num;
@@ -508,12 +508,11 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
 		config.of_node = match_of_node(i);
 		config.ena_gpio = -EINVAL;
 
-		pfuze_chip->regulators[i] =
-			devm_regulator_register(&client->dev, desc, &config);
-		if (IS_ERR(pfuze_chip->regulators[i])) {
+		rdev = devm_regulator_register(&client->dev, desc, &config);
+		if (IS_ERR(rdev)) {
 			dev_err(&client->dev, "register regulator%s failed\n",
 				pfuze_regulators[i].desc.name);
-			return PTR_ERR(pfuze_chip->regulators[i]);
+			return PTR_ERR(rdev);
 		}
 	}
 
-- 
1.8.3.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ