mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865
@ 2014-03-08 13:19 Axel Lin
  2014-03-10  0:56 ` Yang, Wenyou
  2014-03-10 10:30 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2014-03-08 13:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: Wenyou Yang, Liam Girdwood, linux-kernel

Now we are using devm_regulator_register(), so we don't need the *rdev[] array
to store return value of devm_regulator_register. Use a *rdev variable is
enough for checking return status.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/act8865-regulator.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index a5ff30c..b92d7dd 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -62,7 +62,6 @@
 #define	ACT8865_VOLTAGE_NUM	64
 
 struct act8865 {
-	struct regulator_dev *rdev[ACT8865_REG_NUM];
 	struct regmap *regmap;
 };
 
@@ -256,7 +255,7 @@ static inline int act8865_pdata_from_dt(struct device *dev,
 static int act8865_pmic_probe(struct i2c_client *client,
 			   const struct i2c_device_id *i2c_id)
 {
-	struct regulator_dev **rdev;
+	struct regulator_dev *rdev;
 	struct device *dev = &client->dev;
 	struct act8865_platform_data *pdata = dev_get_platdata(dev);
 	struct regulator_config config = { };
@@ -290,8 +289,6 @@ static int act8865_pmic_probe(struct i2c_client *client,
 	if (!act8865)
 		return -ENOMEM;
 
-	rdev = act8865->rdev;
-
 	act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
 	if (IS_ERR(act8865->regmap)) {
 		error = PTR_ERR(act8865->regmap);
@@ -311,12 +308,12 @@ static int act8865_pmic_probe(struct i2c_client *client,
 		config.driver_data = act8865;
 		config.regmap = act8865->regmap;
 
-		rdev[i] = devm_regulator_register(&client->dev,
-						&act8865_reg[i], &config);
-		if (IS_ERR(rdev[i])) {
+		rdev = devm_regulator_register(&client->dev, &act8865_reg[i],
+					       &config);
+		if (IS_ERR(rdev)) {
 			dev_err(dev, "failed to register %s\n",
 				act8865_reg[id].name);
-			return PTR_ERR(rdev[i]);
+			return PTR_ERR(rdev);
 		}
 	}
 
-- 
1.8.1.2




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

* RE: [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865
  2014-03-08 13:19 [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865 Axel Lin
@ 2014-03-10  0:56 ` Yang, Wenyou
  2014-03-10 10:30 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Yang, Wenyou @ 2014-03-10  0:56 UTC (permalink / raw)
  To: Axel Lin, Mark Brown; +Cc: Liam Girdwood, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2514 bytes --]



> -----Original Message-----
> From: Axel Lin [mailto:axel.lin@ingics.com]
> Sent: Saturday, March 08, 2014 9:19 PM
> To: Mark Brown
> Cc: Yang, Wenyou; Liam Girdwood; linux-kernel@vger.kernel.org
> Subject: [PATCH] regulator: act8865: Remove unnecessary *rdev[] from
> struct act8865
> 
> Now we are using devm_regulator_register(), so we don't need the *rdev[]
> array to store return value of devm_regulator_register. Use a *rdev
> variable is enough for checking return status.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Wenyou Yang <Wenyou.yang@atmel.com>
> ---
>  drivers/regulator/act8865-regulator.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/regulator/act8865-regulator.c
> b/drivers/regulator/act8865-regulator.c
> index a5ff30c..b92d7dd 100644
> --- a/drivers/regulator/act8865-regulator.c
> +++ b/drivers/regulator/act8865-regulator.c
> @@ -62,7 +62,6 @@
>  #define	ACT8865_VOLTAGE_NUM	64
> 
>  struct act8865 {
> -	struct regulator_dev *rdev[ACT8865_REG_NUM];
>  	struct regmap *regmap;
>  };
> 
> @@ -256,7 +255,7 @@ static inline int act8865_pdata_from_dt(struct
> device *dev,  static int act8865_pmic_probe(struct i2c_client *client,
>  			   const struct i2c_device_id *i2c_id)  {
> -	struct regulator_dev **rdev;
> +	struct regulator_dev *rdev;
>  	struct device *dev = &client->dev;
>  	struct act8865_platform_data *pdata = dev_get_platdata(dev);
>  	struct regulator_config config = { };
> @@ -290,8 +289,6 @@ static int act8865_pmic_probe(struct i2c_client
> *client,
>  	if (!act8865)
>  		return -ENOMEM;
> 
> -	rdev = act8865->rdev;
> -
>  	act8865->regmap = devm_regmap_init_i2c(client,
> &act8865_regmap_config);
>  	if (IS_ERR(act8865->regmap)) {
>  		error = PTR_ERR(act8865->regmap);
> @@ -311,12 +308,12 @@ static int act8865_pmic_probe(struct i2c_client
> *client,
>  		config.driver_data = act8865;
>  		config.regmap = act8865->regmap;
> 
> -		rdev[i] = devm_regulator_register(&client->dev,
> -						&act8865_reg[i], &config);
> -		if (IS_ERR(rdev[i])) {
> +		rdev = devm_regulator_register(&client->dev, &act8865_reg[i],
> +					       &config);
> +		if (IS_ERR(rdev)) {
>  			dev_err(dev, "failed to register %s\n",
>  				act8865_reg[id].name);
> -			return PTR_ERR(rdev[i]);
> +			return PTR_ERR(rdev);
>  		}
>  	}
> 
> --
> 1.8.1.2
> 
> 

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865
  2014-03-08 13:19 [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865 Axel Lin
  2014-03-10  0:56 ` Yang, Wenyou
@ 2014-03-10 10:30 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-03-10 10:30 UTC (permalink / raw)
  To: Axel Lin; +Cc: Wenyou Yang, Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

On Sat, Mar 08, 2014 at 09:19:07PM +0800, Axel Lin wrote:
> Now we are using devm_regulator_register(), so we don't need the *rdev[] array
> to store return value of devm_regulator_register. Use a *rdev variable is
> enough for checking return status.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-03-10 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-08 13:19 [PATCH] regulator: act8865: Remove unnecessary *rdev[] from struct act8865 Axel Lin
2014-03-10  0:56 ` Yang, Wenyou
2014-03-10 10:30 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome