2014-02-18 10:46:46

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 01/15] regulator: wm8350: Do not hardcode return value

Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/wm8350-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index de7b9c73e3fa..7ec7c390eeda 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -361,7 +361,7 @@ static int wm8350_dcdc_set_suspend_voltage(struct regulator_dev *rdev, int uV)

sel = regulator_map_voltage_linear(rdev, uV, uV);
if (sel < 0)
- return -EINVAL;
+ return sel;

/* all DCDCs have same mV bits */
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_DC1_VSEL_MASK;
@@ -574,7 +574,7 @@ static int wm8350_ldo_set_suspend_voltage(struct regulator_dev *rdev, int uV)

sel = regulator_map_voltage_linear_range(rdev, uV, uV);
if (sel < 0)
- return -EINVAL;
+ return sel;

/* all LDOs have same mV bits */
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK;
--
1.7.9.5


2014-02-18 10:46:51

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 02/15] regulator: ti-abb: Do not hardcode return value

Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/ti-abb-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index 804c83a31d69..75fa64769b4b 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -522,7 +522,7 @@ static int ti_abb_init_table(struct device *dev, struct ti_abb *abb,
num_entries = of_property_count_u32_elems(dev->of_node, pname);
if (num_entries < 0) {
dev_err(dev, "No '%s' property?\n", pname);
- return -ENODEV;
+ return num_entries;
}

if (!num_entries || (num_entries % num_values)) {
--
1.7.9.5

2014-02-18 10:47:03

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 04/15] regulator: max8973: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/max8973-regulator.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index 892aa1e5b96c..79f57fef0038 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -379,10 +379,8 @@ static int max8973_probe(struct i2c_client *client,
}

max = devm_kzalloc(&client->dev, sizeof(*max), GFP_KERNEL);
- if (!max) {
- dev_err(&client->dev, "Memory allocation for max failed\n");
+ if (!max)
return -ENOMEM;
- }

max->regmap = devm_regmap_init_i2c(client, &max8973_regmap_config);
if (IS_ERR(max->regmap)) {
--
1.7.9.5

2014-02-18 10:47:08

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 07/15] regulator: lp3971: Do not hardcode return value

Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/lp3971.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c
index 3b1102b75071..66fd2330dca0 100644
--- a/drivers/regulator/lp3971.c
+++ b/drivers/regulator/lp3971.c
@@ -327,7 +327,7 @@ static int lp3971_i2c_read(struct i2c_client *i2c, char reg, int count,
return -EIO;
ret = i2c_smbus_read_byte_data(i2c, reg);
if (ret < 0)
- return -EIO;
+ return ret;

*dest = ret;
return 0;
--
1.7.9.5

2014-02-18 10:47:11

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 09/15] regulator: da9063: Do not hardcode return values

Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/da9063-regulator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index a61b5d997a08..22ba992e73f2 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -365,7 +365,7 @@ static int da9063_set_suspend_voltage(struct regulator_dev *rdev, int uV)

sel = regulator_map_voltage_linear(rdev, uV, uV);
if (sel < 0)
- return -EINVAL;
+ return sel;

sel <<= ffs(rdev->desc->vsel_mask) - 1;

@@ -757,7 +757,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
if (ret < 0) {
dev_err(&pdev->dev,
"Error while reading BUCKs configuration\n");
- return -EIO;
+ return ret;
}
bcores_merged = val & DA9063_BCORE_MERGE;
bmem_bio_merged = val & DA9063_BUCK_MERGE;
--
1.7.9.5

2014-02-18 10:47:17

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 10/15] regulator: da9055: Do not hardcode return value

Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/da9055-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c
index 126e7c6d2c12..9516317e1a9f 100644
--- a/drivers/regulator/da9055-regulator.c
+++ b/drivers/regulator/da9055-regulator.c
@@ -567,7 +567,7 @@ static int da9055_regulator_dt_init(struct platform_device *pdev,
of_node_put(nproot);
if (ret < 0) {
dev_err(&pdev->dev, "Error matching regulator: %d\n", ret);
- return -ENODEV;
+ return ret;
}

config->init_data = da9055_reg_matches[regid].init_data;
--
1.7.9.5

2014-02-18 10:47:25

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 12/15] regulator: act8865: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/act8865-regulator.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 2d2c3b004ab7..a5ff30c8a1e3 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -228,11 +228,8 @@ static int act8865_pdata_from_dt(struct device *dev,
pdata->regulators = devm_kzalloc(dev,
sizeof(struct act8865_regulator_data) *
ARRAY_SIZE(act8865_matches), GFP_KERNEL);
- if (!pdata->regulators) {
- dev_err(dev, "%s: failed to allocate act8865 registor\n",
- __func__);
+ if (!pdata->regulators)
return -ENOMEM;
- }

pdata->num_regulators = matched;
regulator = pdata->regulators;
--
1.7.9.5

2014-02-18 10:47:30

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 13/15] regulator: arizona-ldo1: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/arizona-ldo1.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c
index 4f6c2055f6b2..d8e7db696d5a 100644
--- a/drivers/regulator/arizona-ldo1.c
+++ b/drivers/regulator/arizona-ldo1.c
@@ -189,10 +189,8 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
int ret;

ldo1 = devm_kzalloc(&pdev->dev, sizeof(*ldo1), GFP_KERNEL);
- if (ldo1 == NULL) {
- dev_err(&pdev->dev, "Unable to allocate private data\n");
+ if (!ldo1)
return -ENOMEM;
- }

ldo1->arizona = arizona;

--
1.7.9.5

2014-02-18 10:47:34

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 15/15] regulator: as3711: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/as3711-regulator.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c
index 856c55f3a832..b47283f91e2d 100644
--- a/drivers/regulator/as3711-regulator.c
+++ b/drivers/regulator/as3711-regulator.c
@@ -245,10 +245,8 @@ static int as3711_regulator_probe(struct platform_device *pdev)

regs = devm_kzalloc(&pdev->dev, AS3711_REGULATOR_NUM *
sizeof(struct as3711_regulator), GFP_KERNEL);
- if (!regs) {
- dev_err(&pdev->dev, "Memory allocation failed exiting..\n");
+ if (!regs)
return -ENOMEM;
- }

for (id = 0, ri = as3711_reg_info; id < AS3711_REGULATOR_NUM; ++id, ri++) {
reg = &regs[id];
--
1.7.9.5

2014-02-18 10:47:59

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 14/15] regulator: arizona-micsupp: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/arizona-micsupp.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/arizona-micsupp.c b/drivers/regulator/arizona-micsupp.c
index 034ece707083..6fdd9bf6927f 100644
--- a/drivers/regulator/arizona-micsupp.c
+++ b/drivers/regulator/arizona-micsupp.c
@@ -204,10 +204,8 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
int ret;

micsupp = devm_kzalloc(&pdev->dev, sizeof(*micsupp), GFP_KERNEL);
- if (micsupp == NULL) {
- dev_err(&pdev->dev, "Unable to allocate private data\n");
+ if (!micsupp)
return -ENOMEM;
- }

micsupp->arizona = arizona;
INIT_WORK(&micsupp->check_cp_work, arizona_micsupp_check_cp);
--
1.7.9.5

2014-02-18 10:47:21

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 11/15] regulator: 88pm800: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/88pm800.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index d333f7eac106..7a721d67e6ac 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -310,10 +310,8 @@ static int pm800_regulator_probe(struct platform_device *pdev)

pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
GFP_KERNEL);
- if (!pm800_data) {
- dev_err(&pdev->dev, "Failed to allocate pm800_regualtors");
+ if (!pm800_data)
return -ENOMEM;
- }

pm800_data->map = chip->subchip->regmap_power;
pm800_data->chip = chip;
--
1.7.9.5

2014-02-18 10:49:22

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 08/15] regulator: fan53555: Do not hardcode return values

Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/fan53555.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 7ca3d9e3b0fe..a10df7d150cc 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -90,11 +90,11 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
return 0;
ret = regulator_map_voltage_linear(rdev, uV, uV);
if (ret < 0)
- return -EINVAL;
+ return ret;
ret = regmap_update_bits(di->regmap, di->sleep_reg,
VSEL_NSEL_MASK, ret);
if (ret < 0)
- return -EINVAL;
+ return ret;
/* Cache the sleep voltage setting.
* Might not be the real voltage which is rounded */
di->sleep_vol_cache = uV;
@@ -260,14 +260,14 @@ static int fan53555_regulator_probe(struct i2c_client *client,
ret = regmap_read(di->regmap, FAN53555_ID1, &val);
if (ret < 0) {
dev_err(&client->dev, "Failed to get chip ID!\n");
- return -ENODEV;
+ return ret;
}
di->chip_id = val & DIE_ID;
/* Get chip revision */
ret = regmap_read(di->regmap, FAN53555_ID2, &val);
if (ret < 0) {
dev_err(&client->dev, "Failed to get chip Rev!\n");
- return -ENODEV;
+ return ret;
}
di->chip_rev = val & DIE_REV;
dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n",
--
1.7.9.5

2014-02-18 10:49:49

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 06/15] regulator: lp872x: Do not hardcode return values

Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/lp872x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 2e4734ff79fc..2e022aabd951 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -211,7 +211,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp)

ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val);
if (ret)
- return -EINVAL;
+ return ret;

val = (val & mask) >> shift;
if (val >= size)
@@ -229,7 +229,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev)
u8 addr, val;

if (time_step_us < 0)
- return -EINVAL;
+ return time_step_us;

switch (rid) {
case LP8720_ID_LDO1 ... LP8720_ID_BUCK:
--
1.7.9.5

2014-02-18 10:46:59

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 05/15] regulator: max8925: Do not hardcode return value

Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/max8925-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c
index 5b939894bfc4..9c859ed4131b 100644
--- a/drivers/regulator/max8925-regulator.c
+++ b/drivers/regulator/max8925-regulator.c
@@ -264,7 +264,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev,
&max8925_regulator_matches[ridx], 1);
of_node_put(np);
if (rcount < 0)
- return -ENODEV;
+ return rcount;
config->init_data = max8925_regulator_matches[ridx].init_data;
config->of_node = max8925_regulator_matches[ridx].of_node;

--
1.7.9.5

2014-02-18 10:50:54

by Sachin Kamat

[permalink] [raw]
Subject: [PATCH 03/15] regulator: ti-abb: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/regulator/ti-abb-regulator.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c
index 75fa64769b4b..a2dabb575b97 100644
--- a/drivers/regulator/ti-abb-regulator.c
+++ b/drivers/regulator/ti-abb-regulator.c
@@ -533,20 +533,15 @@ static int ti_abb_init_table(struct device *dev, struct ti_abb *abb,
num_entries /= num_values;

info = devm_kzalloc(dev, sizeof(*info) * num_entries, GFP_KERNEL);
- if (!info) {
- dev_err(dev, "Can't allocate info table for '%s' property\n",
- pname);
+ if (!info)
return -ENOMEM;
- }
+
abb->info = info;

volt_table = devm_kzalloc(dev, sizeof(unsigned int) * num_entries,
GFP_KERNEL);
- if (!volt_table) {
- dev_err(dev, "Can't allocate voltage table for '%s' property\n",
- pname);
+ if (!volt_table)
return -ENOMEM;
- }

abb->rdesc.n_voltages = num_entries;
abb->rdesc.volt_table = volt_table;
--
1.7.9.5

2014-02-19 07:56:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 01/15] regulator: wm8350: Do not hardcode return value

On Tue, Feb 18, 2014 at 04:10:57PM +0530, Sachin Kamat wrote:
> Propagate the error value returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (142.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 13:07:21

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 02/15] regulator: ti-abb: Do not hardcode return value

On Tue, Feb 18, 2014 at 04:10:58PM +0530, Sachin Kamat wrote:
> Propagate the error value returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (142.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 13:07:33

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 03/15] regulator: ti-abb: Remove redundant error message

On Tue, Feb 18, 2014 at 04:10:59PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thanks.


Attachments:
(No filename) (131.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 13:08:21

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 04/15] regulator: max8973: Remove redundant error message

On Tue, Feb 18, 2014 at 04:11:00PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thanks.


Attachments:
(No filename) (131.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 13:58:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 05/15] regulator: max8925: Do not hardcode return value

On Tue, Feb 18, 2014 at 04:11:01PM +0530, Sachin Kamat wrote:
> Propagate the error value returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (142.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:28:04

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 06/15] regulator: lp872x: Do not hardcode return values

On Tue, Feb 18, 2014 at 04:11:02PM +0530, Sachin Kamat wrote:
> Propagate the error values returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (143.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:28:42

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 07/15] regulator: lp3971: Do not hardcode return value

On Tue, Feb 18, 2014 at 04:11:03PM +0530, Sachin Kamat wrote:
> Propagate the error value returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (142.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:30:51

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 08/15] regulator: fan53555: Do not hardcode return values

On Tue, Feb 18, 2014 at 04:11:04PM +0530, Sachin Kamat wrote:
> Propagate the error values returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (143.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:32:18

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 09/15] regulator: da9063: Do not hardcode return values

On Tue, Feb 18, 2014 at 04:11:05PM +0530, Sachin Kamat wrote:
> Propagate the error values returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (143.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:34:24

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 10/15] regulator: da9055: Do not hardcode return value

On Tue, Feb 18, 2014 at 04:11:06PM +0530, Sachin Kamat wrote:
> Propagate the error value returned by the function instead.

Applied, thanks.


Attachments:
(No filename) (142.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:35:17

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 11/15] regulator: 88pm800: Remove redundant error message

On Tue, Feb 18, 2014 at 04:11:07PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thansk.


Attachments:
(No filename) (131.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:36:10

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 12/15] regulator: act8865: Remove redundant error message

On Tue, Feb 18, 2014 at 04:11:08PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thanks


Attachments:
(No filename) (130.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:38:34

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 13/15] regulator: arizona-ldo1: Remove redundant error message

On Tue, Feb 18, 2014 at 04:11:09PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thanks. Remember to CC maintainers on patches.


Attachments:
(No filename) (171.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments

2014-02-19 16:38:47

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 14/15] regulator: arizona-micsupp: Remove redundant error message

On Tue, Feb 18, 2014 at 04:11:10PM +0530, Sachin Kamat wrote:
> kzalloc prints its own OOM message upon failure.

Applied, thanks.


Attachments:
(No filename) (131.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments