All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get
@ 2013-05-29 11:45 Nikolay Balandin
  2013-05-29 19:15 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Balandin @ 2013-05-29 11:45 UTC (permalink / raw)
  To: Eric Piel, linux-kernel; +Cc: Nikolay Balandin

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

Use devm_regulator_bulk_get to make cleanup paths simpler

Signed-off-by: Nikolay Balandin <nbalandin@dev.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get
  2013-05-29 11:45 [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get Nikolay Balandin
@ 2013-05-29 19:15 ` Andy Shevchenko
       [not found]   ` <51A6F9D9.30900@dev.rtsoft.ru>
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2013-05-29 19:15 UTC (permalink / raw)
  To: Nikolay Balandin; +Cc: Eric Piel, linux-kernel, Nikolay Balandin

On Wed, May 29, 2013 at 2:45 PM, Nikolay Balandin
<n.a.balandin@gmail.com> wrote:
> From: Nikolay Balandin <nbalandin@dev.rtsoft.ru>
>
> Use devm_regulator_bulk_get to make cleanup paths simpler

Do you plan to use this driver somewhere outside of Nokia n900 device?
If so, there is more than this clean up to do.

Otherwise I don't think we have to touch that driver at all.

--
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get
       [not found]   ` <51A6F9D9.30900@dev.rtsoft.ru>
@ 2013-05-30 11:55     ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2013-05-30 11:55 UTC (permalink / raw)
  To: Nikolay Balandin; +Cc: Nikolay Balandin, Eric Piel, linux-kernel

On Thu, May 30, 2013 at 10:03 AM, Nikolay Balandin
<nbalandin@dev.rtsoft.ru> wrote:

>   Yes, this accelerometer is present on the Kontron SMARC evaluation
> carrier.
> http://emea.kontron.com/products/computeronmodules/smarc/smarc+evaluation+carrier.html

Good.

I think you may do following things:
- update lis3lv02d.c to  use devm_* functions
- and then update i2c driver to use devm_*

Are you going to support that platform via DeviceTree model?

> On Wed, May 29, 2013 at 2:45 PM, Nikolay Balandin
> <n.a.balandin@gmail.com> wrote:
> Use devm_regulator_bulk_get to make cleanup paths simpler
>
> Do you plan to use this driver somewhere outside of Nokia n900 device?
> If so, there is more than this clean up to do.
>
> Otherwise I don't think we have to touch that driver at all.


--
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-30 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 11:45 [PATCH v1 1/1] drivers/misc: lis3lv02d: convert to use devm_regulator_bulk_get Nikolay Balandin
2013-05-29 19:15 ` Andy Shevchenko
     [not found]   ` <51A6F9D9.30900@dev.rtsoft.ru>
2013-05-30 11:55     ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.