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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369827913-31033-1-git-send-email-n.a.balandin@gmail.com>
Date:	Wed, 29 May 2013 15:45:13 +0400
From:	Nikolay Balandin <n.a.balandin@...il.com>
To:	Eric Piel <eric.piel@...mplin-utc.net>,
	linux-kernel@...r.kernel.org
Cc:	Nikolay Balandin <nbalandin@....rtsoft.ru>
Subject: [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get

From: Nikolay Balandin <nbalandin@....rtsoft.ru>

Use devm_regulator_bulk_get to make cleanup paths simpler

Signed-off-by: Nikolay Balandin <nbalandin@....rtsoft.ru>
---
 drivers/misc/lis3lv02d/lis3lv02d_i2c.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index 7c97550..01ddcf0 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -154,7 +154,7 @@ static int lis3lv02d_i2c_probe(struct i2c_client *client,
 
 	lis3_dev.regulators[0].supply = reg_vdd;
 	lis3_dev.regulators[1].supply = reg_vdd_io;
-	ret = regulator_bulk_get(&client->dev,
+	ret = devm_regulator_bulk_get(&client->dev,
 				 ARRAY_SIZE(lis3_dev.regulators),
 				 lis3_dev.regulators);
 	if (ret < 0)
@@ -179,12 +179,9 @@ static int lis3lv02d_i2c_probe(struct i2c_client *client,
 	lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
 
 	if (ret)
-		goto fail2;
+		goto fail;
 	return 0;
 
-fail2:
-	regulator_bulk_free(ARRAY_SIZE(lis3_dev.regulators),
-				lis3_dev.regulators);
 fail:
 	if (pdata && pdata->release_resources)
 		pdata->release_resources();
@@ -202,8 +199,6 @@ static int lis3lv02d_i2c_remove(struct i2c_client *client)
 	lis3lv02d_joystick_disable(lis3);
 	lis3lv02d_remove_fs(&lis3_dev);
 
-	regulator_bulk_free(ARRAY_SIZE(lis3->regulators),
-			    lis3_dev.regulators);
 	return 0;
 }
 
-- 
1.7.9.5

--
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