All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe
@ 2014-06-30  7:32 Axel Lin
  2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
  2014-07-02 11:38 ` [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2014-06-30  7:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: Beniamino Galvani, Wenyou.Yang, Liam Girdwood, linux-kernel

Simply use ret variable instead.
Also remove unneeded initialize for ret variable.

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

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index fe2c038..f07be36 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -278,8 +278,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
 	struct act8865 *act8865;
 	struct device_node *of_node[ACT8865_REG_NUM];
 	int i;
-	int ret = -EINVAL;
-	int error;
+	int ret;
 
 	if (dev->of_node && !pdata) {
 		const struct of_device_id *id;
@@ -307,10 +306,10 @@ static int act8865_pmic_probe(struct i2c_client *client,
 
 	act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
 	if (IS_ERR(act8865->regmap)) {
-		error = PTR_ERR(act8865->regmap);
+		ret = PTR_ERR(act8865->regmap);
 		dev_err(&client->dev, "Failed to allocate register map: %d\n",
-			error);
-		return error;
+			ret);
+		return ret;
 	}
 
 	/* Finally register devices */
-- 
1.9.1




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

* [PATCH 2/2] regulator: act8865: Explictly initialize of_node array
  2014-06-30  7:32 [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Axel Lin
@ 2014-06-30  7:33 ` Axel Lin
  2014-06-30 21:23   ` Beniamino Galvani
  2014-07-02 11:38 ` [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2014-06-30  7:33 UTC (permalink / raw)
  To: Mark Brown; +Cc: Beniamino Galvani, Wenyou.Yang, Liam Girdwood, linux-kernel

Silence below build warning:
  CC [M]  drivers/regulator/act8865-regulator.o
drivers/regulator/act8865-regulator.c: In function ‘act8865_pmic_probe’:
drivers/regulator/act8865-regulator.c:321: warning: ‘of_node’ may be used uninitialized in this function

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/act8865-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index f07be36..e9fea78 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -276,7 +276,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
 	struct act8865_platform_data *pdata = dev_get_platdata(dev);
 	struct regulator_config config = { };
 	struct act8865 *act8865;
-	struct device_node *of_node[ACT8865_REG_NUM];
+	struct device_node *of_node[ACT8865_REG_NUM] = { };
 	int i;
 	int ret;
 
-- 
1.9.1




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

* Re: [PATCH 2/2] regulator: act8865: Explictly initialize of_node array
  2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
@ 2014-06-30 21:23   ` Beniamino Galvani
  0 siblings, 0 replies; 4+ messages in thread
From: Beniamino Galvani @ 2014-06-30 21:23 UTC (permalink / raw)
  To: Axel Lin; +Cc: Mark Brown, Wenyou.Yang, Liam Girdwood, linux-kernel

On Mon, Jun 30, 2014 at 03:33:25PM +0800, Axel Lin wrote:
> Silence below build warning:
>   CC [M]  drivers/regulator/act8865-regulator.o
> drivers/regulator/act8865-regulator.c: In function ‘act8865_pmic_probe’:
> drivers/regulator/act8865-regulator.c:321: warning: ‘of_node’ may be used uninitialized in this function

Hi Axel,

some days ago I submitted a patch series that adds support for other
act88xx chips to the driver and reworks the probe function, also
indirectly fixing the warning about uninitialized of_node:

http://lists.infradead.org/pipermail/linux-arm-kernel/2014-June/265477.html

Beniamino

> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/regulator/act8865-regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
> index f07be36..e9fea78 100644
> --- a/drivers/regulator/act8865-regulator.c
> +++ b/drivers/regulator/act8865-regulator.c
> @@ -276,7 +276,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
>  	struct act8865_platform_data *pdata = dev_get_platdata(dev);
>  	struct regulator_config config = { };
>  	struct act8865 *act8865;
> -	struct device_node *of_node[ACT8865_REG_NUM];
> +	struct device_node *of_node[ACT8865_REG_NUM] = { };
>  	int i;
>  	int ret;
>  
> -- 
> 1.9.1



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

* Re: [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe
  2014-06-30  7:32 [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Axel Lin
  2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
@ 2014-07-02 11:38 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2014-07-02 11:38 UTC (permalink / raw)
  To: Axel Lin; +Cc: Beniamino Galvani, Wenyou.Yang, Liam Girdwood, linux-kernel

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

On Mon, Jun 30, 2014 at 03:32:09PM +0800, Axel Lin wrote:
> Simply use ret variable instead.
> Also remove unneeded initialize for ret variable.

Applied, thanks.

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

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

end of thread, other threads:[~2014-07-02 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-30  7:32 [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Axel Lin
2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
2014-06-30 21:23   ` Beniamino Galvani
2014-07-02 11:38 ` [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Mark Brown

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.