[PATCH 3/9] regulator: da9063: Add missing of_node_put

2014-02-17 Thread Sachin Kamat
Add of_node_put to decrement the ref count.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/da9063-regulator.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/da9063-regulator.c 
b/drivers/regulator/da9063-regulator.c
index bfd7f2f795a6..a61b5d997a08 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -674,6 +674,7 @@ static struct da9063_regulators_pdata 
*da9063_parse_regulators_dt(
 
num = of_regulator_match(pdev-dev, node, da9063_matches,
 ARRAY_SIZE(da9063_matches));
+   of_node_put(node);
if (num  0) {
dev_err(pdev-dev, Failed to match regulators\n);
return ERR_PTR(-EINVAL);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/9] regulator: as3722: Add missing of_node_put

2014-02-17 Thread Sachin Kamat
Add of_node_put to decrement the ref count.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/as3722-regulator.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/as3722-regulator.c 
b/drivers/regulator/as3722-regulator.c
index 8b17d786cb71..85585219ce82 100644
--- a/drivers/regulator/as3722-regulator.c
+++ b/drivers/regulator/as3722-regulator.c
@@ -719,6 +719,7 @@ static int as3722_get_regulator_dt_data(struct 
platform_device *pdev,
 
ret = of_regulator_match(pdev-dev, np, as3722_regulator_matches,
ARRAY_SIZE(as3722_regulator_matches));
+   of_node_put(np);
if (ret  0) {
dev_err(pdev-dev, Parsing of regulator node failed: %d\n,
ret);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] tty: tty_ldisc.h: Remove duplicate include

2014-02-17 Thread Sachin Kamat
linux/wait.h was included twice.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 include/linux/tty_ldisc.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index b8347c207cb8..add26da2faeb 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -126,7 +126,6 @@
 
 #include linux/fs.h
 #include linux/wait.h
-#include linux/wait.h
 
 
 /*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
Propagate the error value returned by the function instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2014-02-18 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pfuze100-regulator: Revert regulator: pfuze100: Use of_get_child_by_name

2014-02-18 Thread Sachin Kamat
On 18 February 2014 21:20, Fabio Estevam fabio.este...@freescale.com wrote:
 Since commit d7857c42 (regulator: pfuze100: Use of_get_child_by_name) we get
 the following probe failure:

 pfuze100-regulator 1-0008: Full layer: 1, Metal layer: 0
 pfuze100-regulator 1-0008: FAB: 0, FIN: 0
 pfuze100-regulator 1-0008: regulators node not found
 pfuze100-regulator: probe of 1-0008 failed with error -22

 Revert the offending commit so that we can probe the regulator successfully.

I wonder what is different in this case from the ones that I already
have working
that is causing this to fail. Can you please tell me which dts file
you have used
so that I can see if the way the node is defined is anything different.

 ---
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment

2014-02-18 Thread Sachin Kamat
On 19 February 2014 05:58, SeongJae Park sj38.p...@gmail.com wrote:
 On Wed, Feb 19, 2014 at 2:07 AM, Greg KH gre...@linuxfoundation.org wrote:
 On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
 Signed-off-by: SeongJae Park sj38.p...@gmail.com
 ---
  drivers/staging/android/binder.c | 2 --
  1 file changed, 2 deletions(-)

 diff --git a/drivers/staging/android/binder.c 
 b/drivers/staging/android/binder.c
 index eaec1da..b23cbc9 100644
 --- a/drivers/staging/android/binder.c
 +++ b/drivers/staging/android/binder.c
 @@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned 
 int cmd, unsigned long arg)
   unsigned int size = _IOC_SIZE(cmd);
   void __user *ubuf = (void __user *)arg;

 - /*pr_info(binder_ioctl: %d:%d %x %lx\n, proc-pid, current-pid, 
 cmd, arg);*/

 It's useful for debugging, I'll leave it as-is, sorry.

Or just convert pr_info to pr_debug and leave uncommented?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pfuze100-regulator: Revert regulator: pfuze100: Use of_get_child_by_name

2014-02-18 Thread Sachin Kamat
On 19 February 2014 07:42, Shawn Guo shawn@linaro.org wrote:
 On Tue, Feb 18, 2014 at 09:58:52PM +0530, Sachin Kamat wrote:
 On 18 February 2014 21:20, Fabio Estevam fabio.este...@freescale.com wrote:
  Since commit d7857c42 (regulator: pfuze100: Use of_get_child_by_name) we 
  get
  the following probe failure:
 
  pfuze100-regulator 1-0008: Full layer: 1, Metal layer: 0
  pfuze100-regulator 1-0008: FAB: 0, FIN: 0
  pfuze100-regulator 1-0008: regulators node not found
  pfuze100-regulator: probe of 1-0008 failed with error -22
 
  Revert the offending commit so that we can probe the regulator 
  successfully.

 I wonder what is different in this case from the ones that I already
 have working
 that is causing this to fail. Can you please tell me which dts file
 you have used
 so that I can see if the way the node is defined is anything different.

 When you change to use of_get_child_by_name(), you should change 'np' to
 point to dev-of_node too.

Thanks for the tip Shawn. Coincidentally all the ones that I tested
had this (np pointing
to dev-of_node) already. So I happened to miss out on this check.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pfuze100-regulator: Fix of_node_get() parameter

2014-02-18 Thread Sachin Kamat
On 19 February 2014 08:16, Fabio Estevam feste...@gmail.com wrote:
 From: Fabio Estevam fabio.este...@freescale.com

 Since commit d7857c42 (regulator: pfuze100: Use of_get_child_by_name) we get
 the following probe failure:

 pfuze100-regulator 1-0008: Full layer: 1, Metal layer: 0
 pfuze100-regulator 1-0008: FAB: 0, FIN: 0
 pfuze100-regulator 1-0008: regulators node not found
 pfuze100-regulator: probe of 1-0008 failed with error -22

 Now that of_get_child_by_name() is used we should adjust the device_node 
 pointer
 'np' to not get the parent node anymore.

 Suggested-by: Shawn Guo shawn@linaro.org
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

Thanks for the fix Fabio.
Acked-by: Sachin Kamat sachin.ka...@linaro.org

Mark,
There are a few more instances that should be fixed like this one. How would you
prefer to handle them - Resend the complete patch or send just the
incremental fix?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/4] Bugfix for of_match_node ordering

2014-02-20 Thread Sachin Kamat
Hi Grant,

I observe the following boot failure with today's (next-20140220) linux-next
tree on Exynos based boards with the default exynos_defconfig.

Uncompressing Linux... done, booting the kernel.
[0.00] Booting Linux on physical CPU 0x900
[0.00] Linux version 3.14.0-rc3-next-20140220 (sachin@linaro)
(gcc version 4.8.2 20130805 (prerelease) (crosstool-NG linaro-1.
13.1-4.8-2013.08 - Linaro GCC 2013.08) ) #1132 SMP PREEMPT Thu Feb 20
13:49:27 IST 2014
[0.00] CPU: ARMv7 Processor [412fc091] revision 1 (ARMv7), cr=10c5387d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing
instruction cache
[0.00] Machine model: Insignal Origen evaluation board based
on Exynos4210
[0.00] bootconsole [earlycon0] enabled
[0.00] Memory policy: Data cache writealloc
[0.00] CPU EXYNOS4210 (id 0x43210011)
[0.00] On node 0 totalpages: 258048
[0.00]   Normal zone: 1520 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 190464 pages, LIFO batch:31
[0.00]   HighMem zone: 528 pages used for memmap
[0.00]   HighMem zone: 67584 pages, LIFO batch:15
[0.00] BUG: spinlock recursion on CPU#0, swapper/0
[0.00]  lock: devtree_lock+0x0/0x10, .magic: dead4ead, .owner:
swapper/0, .owner_cpu: 0
[0.00] CPU: 0 PID: 0 Comm: swapper Not tainted
3.14.0-rc3-next-20140220 #1132
[0.00] [c0013e9c] (unwind_backtrace) from [c0011250]
(show_stack+0x10/0x14)
[0.00] [c0011250] (show_stack) from [c0386740]
(dump_stack+0x7c/0xbc)
[0.00] [c0386740] (dump_stack) from [c005501c]
(do_raw_spin_lock+0x188/0x18c)
[0.00] [c005501c] (do_raw_spin_lock) from [c038b614]
(_raw_spin_lock_irqsave+0x20/0x28)
[0.00] [c038b614] (_raw_spin_lock_irqsave) from [c02de37c]
(of_find_property+0x20/0x4c)
[0.00] [c02de37c] (of_find_property) from [c02df110]
(__of_device_is_compatible+0xb4/0x110)
[0.00] [c02df110] (__of_device_is_compatible) from
[c02df22c] (of_find_compatible_node+0x4c/0x7c)
[0.00] [c02df22c] (of_find_compatible_node) from
[c04cedf4] (exynos_firmware_init+0x18/0x7c)
[0.00] [c04cedf4] (exynos_firmware_init) from [c04caef0]
(setup_arch+0x860/0x898)
[0.00] [c04caef0] (setup_arch) from [c04c7820]
(start_kernel+0x80/0x3dc)
[0.00] [c04c7820] (start_kernel) from [40008074] (0x40008074)
[0.00] BUG: spinlock lockup suspected on CPU#0, swapper/0
[0.00]  lock: devtree_lock+0x0/0x10, .magic: dead4ead, .owner:
swapper/0, .owner_cpu: 0
[0.00] CPU: 0 PID: 0 Comm: swapper Not tainted
3.14.0-rc3-next-20140220 #1132
[0.00] [c0013e9c] (unwind_backtrace) from [c0011250]
(show_stack+0x10/0x14)
[0.00] [c0011250] (show_stack) from [c0386740]
(dump_stack+0x7c/0xbc)
[0.00] [c0386740] (dump_stack) from [c0054fac]
(do_raw_spin_lock+0x118/0x18c)
[0.00] [c0054fac] (do_raw_spin_lock) from [c038b614]
(_raw_spin_lock_irqsave+0x20/0x28)
[0.00] [c038b614] (_raw_spin_lock_irqsave) from [c02de37c]
(of_find_property+0x20/0x4c)
[0.00] [c02de37c] (of_find_property) from [c02df110]
(__of_device_is_compatible+0xb4/0x110)
[0.00] [c02df110] (__of_device_is_compatible) from
[c02df22c] (of_find_compatible_node+0x4c/0x7c)
[0.00] [c02df22c] (of_find_compatible_node) from
[c04cedf4] (exynos_firmware_init+0x18/0x7c)
[0.00] [c04cedf4] (exynos_firmware_init) from [c04caef0]
(setup_arch+0x860/0x898)
[0.00] [c04caef0] (setup_arch) from [c04c7820]
(start_kernel+0x80/0x3dc)
[0.00] [c04c7820] (start_kernel) from [40008074] (0x40008074)

Regards,
Sachin



On 19 February 2014 19:44, Grant Likely grant.lik...@linaro.org wrote:
 Hi all,

 I've taken Kevin's latest rework and done even more rework on it. :-) I
 didn't quite like how it was looking so I rolled his scoring code
 directly into __of_device_is_compatible() so that the function always
 returns a score in a way that is still compatible with the existing
 users (ie. non-zero == successful match). This eliminates the need for a
 separate pscore argument and it also let me roll the type and name
 checks into the same function. I'm a lot happier with it overall and it
 makes for a slightly smaller number of lines of code changed. Please
 take a look and give it a spin. This is basically a bug fix so I'll need
 to push it out to Linus in the near future.

 Acks and Tested-bys would be particularly appreciated.

 Thanks,
 g.

 Kevin Hao (2):
 Revert of: search the best compatible match first in 
 __of_match_node()
 of: reimplement the matching method for __of_match_node()

 Grant Likely (2):
 of: Move testcase FDT data into drivers/of
 of: Add self test for of_match_node()


 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

[PATCH 02/23] regulator: da9210: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: S Twiss stwiss.opensou...@diasemi.com
---
 drivers/regulator/da9210-regulator.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/regulator/da9210-regulator.c 
b/drivers/regulator/da9210-regulator.c
index 6f5ecbe1132e..7a320dd11c46 100644
--- a/drivers/regulator/da9210-regulator.c
+++ b/drivers/regulator/da9210-regulator.c
@@ -134,11 +134,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
int error;
 
chip = devm_kzalloc(i2c-dev, sizeof(struct da9210), GFP_KERNEL);
-   if (NULL == chip) {
-   dev_err(i2c-dev,
-   Cannot kzalloc memory for regulator structure\n);
+   if (!chip)
return -ENOMEM;
-   }
 
chip-regmap = devm_regmap_init_i2c(i2c, da9210_regmap_config);
if (IS_ERR(chip-regmap)) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/23] regulator: da9063: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Krystian Garbaciak krystian.garbac...@diasemi.com
---
 drivers/regulator/da9063-regulator.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/da9063-regulator.c 
b/drivers/regulator/da9063-regulator.c
index 22ba992e73f2..38ad5e950907 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -776,10 +776,8 @@ static int da9063_regulator_probe(struct platform_device 
*pdev)
size = sizeof(struct da9063_regulators) +
n_regulators * sizeof(struct da9063_regulator);
regulators = devm_kzalloc(pdev-dev, size, GFP_KERNEL);
-   if (!regulators) {
-   dev_err(pdev-dev, No memory for regulators\n);
+   if (!regulators)
return -ENOMEM;
-   }
 
regulators-n_regulators = n_regulators;
platform_set_drvdata(pdev, regulators);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/23] regulator: fixed: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/fixed.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 3c307d62fd31..c61f7e97e4f8 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -130,10 +130,8 @@ static int reg_fixed_voltage_probe(struct platform_device 
*pdev)
 
drvdata = devm_kzalloc(pdev-dev, sizeof(struct fixed_voltage_data),
   GFP_KERNEL);
-   if (drvdata == NULL) {
-   dev_err(pdev-dev, Failed to allocate device data\n);
+   if (!drvdata)
return -ENOMEM;
-   }
 
drvdata-desc.name = devm_kstrdup(pdev-dev,
  config-supply_name,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 13/23] regulator: tps62360: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laxman Dewangan ldewan...@nvidia.com
---
 drivers/regulator/tps62360-regulator.c |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/tps62360-regulator.c 
b/drivers/regulator/tps62360-regulator.c
index c3fa15a299b1..a1672044e519 100644
--- a/drivers/regulator/tps62360-regulator.c
+++ b/drivers/regulator/tps62360-regulator.c
@@ -299,10 +299,8 @@ static struct tps62360_regulator_platform_data *
struct device_node *np = dev-of_node;
 
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-   if (!pdata) {
-   dev_err(dev, Memory alloc failed for platform data\n);
+   if (!pdata)
return NULL;
-   }
 
pdata-reg_init_data = of_get_regulator_init_data(dev, dev-of_node);
if (!pdata-reg_init_data) {
@@ -377,11 +375,8 @@ static int tps62360_probe(struct i2c_client *client,
}
 
tps = devm_kzalloc(client-dev, sizeof(*tps), GFP_KERNEL);
-   if (!tps) {
-   dev_err(client-dev, %s(): Memory allocation failed\n,
-   __func__);
+   if (!tps)
return -ENOMEM;
-   }
 
tps-en_discharge = pdata-en_discharge;
tps-en_internal_pulldn = pdata-en_internal_pulldn;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 22/23] regulator: wm831x-ldo: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/wm831x-ldo.c |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 46d6700467b5..eca0eeb78acd 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -235,10 +235,8 @@ static int wm831x_gp_ldo_probe(struct platform_device 
*pdev)
dev_dbg(pdev-dev, Probing LDO%d\n, id + 1);
 
ldo = devm_kzalloc(pdev-dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
-   if (ldo == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!ldo)
return -ENOMEM;
-   }
 
ldo-wm831x = wm831x;
 
@@ -447,10 +445,8 @@ static int wm831x_aldo_probe(struct platform_device *pdev)
dev_dbg(pdev-dev, Probing LDO%d\n, id + 1);
 
ldo = devm_kzalloc(pdev-dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
-   if (ldo == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!ldo)
return -ENOMEM;
-   }
 
ldo-wm831x = wm831x;
 
@@ -594,10 +590,8 @@ static int wm831x_alive_ldo_probe(struct platform_device 
*pdev)
dev_dbg(pdev-dev, Probing LDO%d\n, id + 1);
 
ldo = devm_kzalloc(pdev-dev, sizeof(struct wm831x_ldo), GFP_KERNEL);
-   if (ldo == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!ldo)
return -ENOMEM;
-   }
 
ldo-wm831x = wm831x;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 20/23] regulator: wm831x-dcdc: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/wm831x-dcdc.c |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c
index 04cf9c16ef23..0d88a82ab2a2 100644
--- a/drivers/regulator/wm831x-dcdc.c
+++ b/drivers/regulator/wm831x-dcdc.c
@@ -469,10 +469,8 @@ static int wm831x_buckv_probe(struct platform_device *pdev)
 
dcdc = devm_kzalloc(pdev-dev,  sizeof(struct wm831x_dcdc),
GFP_KERNEL);
-   if (dcdc == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!dcdc)
return -ENOMEM;
-   }
 
dcdc-wm831x = wm831x;
 
@@ -622,10 +620,8 @@ static int wm831x_buckp_probe(struct platform_device *pdev)
 
dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc),
GFP_KERNEL);
-   if (dcdc == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!dcdc)
return -ENOMEM;
-   }
 
dcdc-wm831x = wm831x;
 
@@ -752,10 +748,8 @@ static int wm831x_boostp_probe(struct platform_device 
*pdev)
return -ENODEV;
 
dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL);
-   if (dcdc == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!dcdc)
return -ENOMEM;
-   }
 
dcdc-wm831x = wm831x;
 
@@ -842,10 +836,8 @@ static int wm831x_epe_probe(struct platform_device *pdev)
dev_dbg(pdev-dev, Probing EPE%d\n, id + 1);
 
dcdc = devm_kzalloc(pdev-dev, sizeof(struct wm831x_dcdc), GFP_KERNEL);
-   if (dcdc == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!dcdc)
return -ENOMEM;
-   }
 
dcdc-wm831x = wm831x;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 23/23] regulator: wm8994: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/wm8994-regulator.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/wm8994-regulator.c 
b/drivers/regulator/wm8994-regulator.c
index 71c5911f2e71..c24346db8a71 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -134,10 +134,8 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
dev_dbg(pdev-dev, Probing LDO%d\n, id + 1);
 
ldo = devm_kzalloc(pdev-dev, sizeof(struct wm8994_ldo), GFP_KERNEL);
-   if (ldo == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!ldo)
return -ENOMEM;
-   }
 
ldo-wm8994 = wm8994;
ldo-supply = wm8994_ldo_consumer[id];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 21/23] regulator: wm831x-isink: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/wm831x-isink.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 0339b886df5d..72e385e76a9d 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -165,10 +165,8 @@ static int wm831x_isink_probe(struct platform_device *pdev)
 
isink = devm_kzalloc(pdev-dev, sizeof(struct wm831x_isink),
 GFP_KERNEL);
-   if (isink == NULL) {
-   dev_err(pdev-dev, Unable to allocate private data\n);
+   if (!isink)
return -ENOMEM;
-   }
 
isink-wm831x = wm831x;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 18/23] regulator: tps65910: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Graeme Gregory g...@slimlogic.co.uk
---
 drivers/regulator/tps65910-regulator.c |   21 +
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/regulator/tps65910-regulator.c 
b/drivers/regulator/tps65910-regulator.c
index f50dd847eebc..fa7db8847578 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -1011,11 +1011,8 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
 
pmic_plat_data = devm_kzalloc(pdev-dev, sizeof(*pmic_plat_data),
GFP_KERNEL);
-
-   if (!pmic_plat_data) {
-   dev_err(pdev-dev, Failure to alloc pdata for regulators.\n);
+   if (!pmic_plat_data)
return NULL;
-   }
 
np = of_node_get(pdev-dev.parent-of_node);
regulators = of_get_child_by_name(np, regulators);
@@ -1098,10 +1095,8 @@ static int tps65910_probe(struct platform_device *pdev)
}
 
pmic = devm_kzalloc(pdev-dev, sizeof(*pmic), GFP_KERNEL);
-   if (!pmic) {
-   dev_err(pdev-dev, Memory allocation failed for pmic\n);
+   if (!pmic)
return -ENOMEM;
-   }
 
pmic-mfd = tps65910;
platform_set_drvdata(pdev, pmic);
@@ -1130,24 +1125,18 @@ static int tps65910_probe(struct platform_device *pdev)
 
pmic-desc = devm_kzalloc(pdev-dev, pmic-num_regulators *
sizeof(struct regulator_desc), GFP_KERNEL);
-   if (!pmic-desc) {
-   dev_err(pdev-dev, Memory alloc fails for desc\n);
+   if (!pmic-desc)
return -ENOMEM;
-   }
 
pmic-info = devm_kzalloc(pdev-dev, pmic-num_regulators *
sizeof(struct tps_info *), GFP_KERNEL);
-   if (!pmic-info) {
-   dev_err(pdev-dev, Memory alloc fails for info\n);
+   if (!pmic-info)
return -ENOMEM;
-   }
 
pmic-rdev = devm_kzalloc(pdev-dev, pmic-num_regulators *
sizeof(struct regulator_dev *), GFP_KERNEL);
-   if (!pmic-rdev) {
-   dev_err(pdev-dev, Memory alloc fails for rdev\n);
+   if (!pmic-rdev)
return -ENOMEM;
-   }
 
for (i = 0; i  pmic-num_regulators  i  TPS65910_NUM_REGS;
i++, info++) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 19/23] regulator: tps80031: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laxman Dewangan ldewan...@nvidia.com
---
 drivers/regulator/tps80031-regulator.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/tps80031-regulator.c 
b/drivers/regulator/tps80031-regulator.c
index 71f457a42623..ac88c988bb2e 100644
--- a/drivers/regulator/tps80031-regulator.c
+++ b/drivers/regulator/tps80031-regulator.c
@@ -693,10 +693,8 @@ static int tps80031_regulator_probe(struct platform_device 
*pdev)
 
pmic = devm_kzalloc(pdev-dev,
TPS80031_REGULATOR_MAX * sizeof(*pmic), GFP_KERNEL);
-   if (!pmic) {
-   dev_err(pdev-dev, mem alloc for pmic failed\n);
+   if (!pmic)
return -ENOMEM;
-   }
 
for (num = 0; num  TPS80031_REGULATOR_MAX; ++num) {
tps_pdata = pdata-regulator_pdata[num];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 16/23] regulator: tps6524x: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/tps6524x-regulator.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/tps6524x-regulator.c 
b/drivers/regulator/tps6524x-regulator.c
index 9f6bfda711b7..5b494db9f95c 100644
--- a/drivers/regulator/tps6524x-regulator.c
+++ b/drivers/regulator/tps6524x-regulator.c
@@ -593,10 +593,9 @@ static int pmic_probe(struct spi_device *spi)
}
 
hw = devm_kzalloc(spi-dev, sizeof(struct tps6524x), GFP_KERNEL);
-   if (!hw) {
-   dev_err(dev, cannot allocate regulator private data\n);
+   if (!hw)
return -ENOMEM;
-   }
+
spi_set_drvdata(spi, hw);
 
memset(hw, 0, sizeof(struct tps6524x));
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 15/23] regulator: tps65090: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Venu Byravarasu vbyravar...@nvidia.com
---
 drivers/regulator/tps65090-regulator.c |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/regulator/tps65090-regulator.c 
b/drivers/regulator/tps65090-regulator.c
index 5674f886c471..2e92ef68574d 100644
--- a/drivers/regulator/tps65090-regulator.c
+++ b/drivers/regulator/tps65090-regulator.c
@@ -168,17 +168,13 @@ static struct tps65090_platform_data 
*tps65090_parse_dt_reg_data(
 
tps65090_pdata = devm_kzalloc(pdev-dev, sizeof(*tps65090_pdata),
GFP_KERNEL);
-   if (!tps65090_pdata) {
-   dev_err(pdev-dev, Memory alloc for tps65090_pdata failed\n);
+   if (!tps65090_pdata)
return ERR_PTR(-ENOMEM);
-   }
 
reg_pdata = devm_kzalloc(pdev-dev, TPS65090_REGULATOR_MAX *
sizeof(*reg_pdata), GFP_KERNEL);
-   if (!reg_pdata) {
-   dev_err(pdev-dev, Memory alloc for reg_pdata failed\n);
+   if (!reg_pdata)
return ERR_PTR(-ENOMEM);
-   }
 
regulators = of_get_child_by_name(np, regulators);
if (!regulators) {
@@ -253,10 +249,8 @@ static int tps65090_regulator_probe(struct platform_device 
*pdev)
 
pmic = devm_kzalloc(pdev-dev, TPS65090_REGULATOR_MAX * sizeof(*pmic),
GFP_KERNEL);
-   if (!pmic) {
-   dev_err(pdev-dev, mem alloc for pmic failed\n);
+   if (!pmic)
return -ENOMEM;
-   }
 
for (num = 0; num  TPS65090_REGULATOR_MAX; num++) {
tps_pdata = tps65090_pdata-reg_pdata[num];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 17/23] regulator: tps6586x: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Mike Rapoport m...@compulab.co.il
---
 drivers/regulator/tps6586x-regulator.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/tps6586x-regulator.c 
b/drivers/regulator/tps6586x-regulator.c
index 0485d47f0d8a..e36f3569767f 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -363,10 +363,8 @@ static struct tps6586x_platform_data 
*tps6586x_parse_regulator_dt(
}
 
pdata = devm_kzalloc(pdev-dev, sizeof(*pdata), GFP_KERNEL);
-   if (!pdata) {
-   dev_err(pdev-dev, Memory alloction failed\n);
+   if (!pdata)
return NULL;
-   }
 
for (i = 0; i  num; i++) {
int id;
@@ -420,10 +418,8 @@ static int tps6586x_regulator_probe(struct platform_device 
*pdev)
 
rdev = devm_kzalloc(pdev-dev, TPS6586X_ID_MAX_REGULATOR *
sizeof(*rdev), GFP_KERNEL);
-   if (!rdev) {
-   dev_err(pdev-dev, Mmemory alloc failed\n);
+   if (!rdev)
return -ENOMEM;
-   }
 
version = tps6586x_get_version(pdev-dev.parent);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 14/23] regulator: tps6507x: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/tps6507x-regulator.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/tps6507x-regulator.c 
b/drivers/regulator/tps6507x-regulator.c
index e506e7f54253..98e66ce26723 100644
--- a/drivers/regulator/tps6507x-regulator.c
+++ b/drivers/regulator/tps6507x-regulator.c
@@ -380,10 +380,8 @@ static struct tps6507x_board *tps6507x_parse_dt_reg_data(
 
tps_board = devm_kzalloc(pdev-dev, sizeof(*tps_board),
GFP_KERNEL);
-   if (!tps_board) {
-   dev_err(pdev-dev, Failure to alloc pdata for regulators.\n);
+   if (!tps_board)
return NULL;
-   }
 
regulators = of_get_child_by_name(np, regulators);
if (!regulators) {
@@ -406,10 +404,8 @@ static struct tps6507x_board *tps6507x_parse_dt_reg_data(
 
reg_data = devm_kzalloc(pdev-dev, (sizeof(struct regulator_init_data)
* TPS6507X_NUM_REGULATOR), GFP_KERNEL);
-   if (!reg_data) {
-   dev_err(pdev-dev, Failure to alloc init data for 
regulators.\n);
+   if (!reg_data)
return NULL;
-   }
 
tps_board-tps6507x_pmic_init_data = reg_data;
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 12/23] regulator: tps51632: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laxman Dewangan ldewan...@nvidia.com
---
 drivers/regulator/tps51632-regulator.c |8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/tps51632-regulator.c 
b/drivers/regulator/tps51632-regulator.c
index b3764f594ee9..f31f22e3e1bd 100644
--- a/drivers/regulator/tps51632-regulator.c
+++ b/drivers/regulator/tps51632-regulator.c
@@ -227,10 +227,8 @@ static struct tps51632_regulator_platform_data *
struct device_node *np = dev-of_node;
 
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-   if (!pdata) {
-   dev_err(dev, Memory alloc failed for platform data\n);
+   if (!pdata)
return NULL;
-   }
 
pdata-reg_init_data = of_get_regulator_init_data(dev, dev-of_node);
if (!pdata-reg_init_data) {
@@ -299,10 +297,8 @@ static int tps51632_probe(struct i2c_client *client,
}
 
tps = devm_kzalloc(client-dev, sizeof(*tps), GFP_KERNEL);
-   if (!tps) {
-   dev_err(client-dev, Memory allocation failed\n);
+   if (!tps)
return -ENOMEM;
-   }
 
tps-dev = client-dev;
tps-desc.name = client-name;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/23] regulator: s5m8767: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Sangbeom Kim sbki...@samsung.com
---
 drivers/regulator/s5m8767.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 4c356b872e6b..342a66ab654a 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -612,19 +612,13 @@ static int s5m8767_pmic_dt_parse_pdata(struct 
platform_device *pdev,
 
rdata = devm_kzalloc(pdev-dev, sizeof(*rdata) *
pdata-num_regulators, GFP_KERNEL);
-   if (!rdata) {
-   dev_err(iodev-dev,
-   could not allocate memory for regulator data\n);
+   if (!rdata)
return -ENOMEM;
-   }
 
rmode = devm_kzalloc(pdev-dev, sizeof(*rmode) *
pdata-num_regulators, GFP_KERNEL);
-   if (!rmode) {
-   dev_err(iodev-dev,
-   could not allocate memory for regulator mode\n);
+   if (!rmode)
return -ENOMEM;
-   }
 
pdata-regulators = rdata;
pdata-opmode = rmode;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 09/23] regulator: max8997: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/max8997.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 10108f2941e3..f657d8db9c0c 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -937,7 +937,6 @@ static int max8997_pmic_dt_parse_pdata(struct 
platform_device *pdev,
pdata-num_regulators, GFP_KERNEL);
if (!rdata) {
of_node_put(regulators_np);
-   dev_err(pdev-dev, could not allocate memory for regulator 
data\n);
return -ENOMEM;
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/23] regulator: rc5t583: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laxman Dewangan ldewan...@nvidia.com
---
 drivers/regulator/rc5t583-regulator.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/rc5t583-regulator.c 
b/drivers/regulator/rc5t583-regulator.c
index 22d6fd1281b1..4c414ae109ae 100644
--- a/drivers/regulator/rc5t583-regulator.c
+++ b/drivers/regulator/rc5t583-regulator.c
@@ -134,10 +134,8 @@ static int rc5t583_regulator_probe(struct platform_device 
*pdev)
 
regs = devm_kzalloc(pdev-dev, RC5T583_REGULATOR_MAX *
sizeof(struct rc5t583_regulator), GFP_KERNEL);
-   if (!regs) {
-   dev_err(pdev-dev, Memory allocation failed exiting..\n);
+   if (!regs)
return -ENOMEM;
-   }
 
 
for (id = 0; id  RC5T583_REGULATOR_MAX; ++id) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/23] regulator: max8952: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/max8952.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index 788e5ae2af1b..66e777967c69 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -144,10 +144,8 @@ static struct max8952_platform_data 
*max8952_parse_dt(struct device *dev)
int i;
 
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
-   if (!pd) {
-   dev_err(dev, Failed to allocate platform data\n);
+   if (!pd)
return NULL;
-   }
 
pd-gpio_vid0 = of_get_named_gpio(np, max8952,vid-gpios, 0);
pd-gpio_vid1 = of_get_named_gpio(np, max8952,vid-gpios, 1);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/23] regulator: max8907: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/max8907-regulator.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/max8907-regulator.c 
b/drivers/regulator/max8907-regulator.c
index afda8c6af721..ed90c759c231 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -292,10 +292,9 @@ static int max8907_regulator_probe(struct platform_device 
*pdev)
return ret;
 
pmic = devm_kzalloc(pdev-dev, sizeof(*pmic), GFP_KERNEL);
-   if (!pmic) {
-   dev_err(pdev-dev, Failed to alloc pmic\n);
+   if (!pmic)
return -ENOMEM;
-   }
+
platform_set_drvdata(pdev, pmic);
 
memcpy(pmic-desc, max8907_regulators, sizeof(pmic-desc));
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/23] regulator: max77686: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/max77686.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index b411af00065d..de020adf0568 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -410,8 +410,6 @@ static int max77686_pmic_dt_parse_pdata(struct 
platform_device *pdev,
rdata = devm_kzalloc(pdev-dev, sizeof(*rdata) *
 pdata-num_regulators, GFP_KERNEL);
if (!rdata) {
-   dev_err(pdev-dev,
-   could not allocate memory for regulator data\n);
of_node_put(regulators_np);
return -ENOMEM;
}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/23] regulator: dbx500: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Sundar Iyer sundar.i...@stericsson.com
---
 drivers/regulator/dbx500-prcmu.c |   10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/dbx500-prcmu.c b/drivers/regulator/dbx500-prcmu.c
index ce89f7848a57..f111dfb8d2d7 100644
--- a/drivers/regulator/dbx500-prcmu.c
+++ b/drivers/regulator/dbx500-prcmu.c
@@ -202,18 +202,12 @@ ux500_regulator_debug_init(struct platform_device *pdev,
rdebug.num_regulators = num_regulators;
 
rdebug.state_before_suspend = kzalloc(num_regulators, GFP_KERNEL);
-   if (!rdebug.state_before_suspend) {
-   dev_err(pdev-dev,
-   could not allocate memory for saving state\n);
+   if (!rdebug.state_before_suspend)
goto exit_destroy_power_state;
-   }
 
rdebug.state_after_suspend = kzalloc(num_regulators, GFP_KERNEL);
-   if (!rdebug.state_after_suspend) {
-   dev_err(pdev-dev,
-   could not allocate memory for saving state\n);
+   if (!rdebug.state_after_suspend)
goto exit_free;
-   }
 
dbx500_regulator_testcase(regulator_info, num_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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/23] regulator: fan53555: Remove redundant error message

2014-02-20 Thread Sachin Kamat
kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Yunfan Zhang yfzh...@marvell.com
---
 drivers/regulator/fan53555.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index a10df7d150cc..714fd9a89aa1 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -244,10 +244,9 @@ static int fan53555_regulator_probe(struct i2c_client 
*client,
 
di = devm_kzalloc(client-dev, sizeof(struct fan53555_device_info),
GFP_KERNEL);
-   if (!di) {
-   dev_err(client-dev, Failed to allocate device info data!\n);
+   if (!di)
return -ENOMEM;
-   }
+
di-regmap = devm_regmap_init_i2c(client, fan53555_regmap_config);
if (IS_ERR(di-regmap)) {
dev_err(client-dev, Failed to allocate regmap!\n);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/4] Bugfix for of_match_node ordering

2014-02-20 Thread Sachin Kamat
Hi Kevin,

On 20 February 2014 15:42, Kevin Hao haoke...@gmail.com wrote:
 On Thu, Feb 20, 2014 at 02:09:08PM +0530, Sachin Kamat wrote:
 Hi Grant,

 I observe the following boot failure with today's (next-20140220) linux-next
 tree on Exynos based boards with the default exynos_defconfig.

 Does this help?

The below patch works for me. Thanks for the fix.


 diff --git a/drivers/of/base.c b/drivers/of/base.c
 index 8a27fc907ab6..9cc893530b9a 100644
 --- a/drivers/of/base.c
 +++ b/drivers/of/base.c
 @@ -381,12 +381,16 @@ static int __of_device_is_compatible(const struct 
 device_node *device,

 /* Compatible match has highest priority */
 if (compat  compat[0]) {
 -   of_property_for_each_string(device, compatible, prop, cp) {
 +   prop = __of_find_property(device, compatible, NULL);
 +   if (!prop)
 +   return 0;
 +
 +   for (cp = of_prop_next_string(prop, NULL); cp;
 +   cp = of_prop_next_string(prop, cp), index++) {
 if (of_compat_cmp(cp, compat, strlen(compat)) == 0) {
 score = INT_MAX/2 - (index  2);
 break;
 }
 -   index++;
 }
 if (!score)
 return 0;


 Thanks,
 Kevin



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/4] Bugfix for of_match_node ordering

2014-02-20 Thread Sachin Kamat
On 20 February 2014 16:25, Kevin Hao haoke...@gmail.com wrote:
 On Thu, Feb 20, 2014 at 03:57:07PM +0530, Sachin Kamat wrote:
 Hi Kevin,

 On 20 February 2014 15:42, Kevin Hao haoke...@gmail.com wrote:
  On Thu, Feb 20, 2014 at 02:09:08PM +0530, Sachin Kamat wrote:
  Hi Grant,
 
  I observe the following boot failure with today's (next-20140220) 
  linux-next
  tree on Exynos based boards with the default exynos_defconfig.
 
  Does this help?

 The below patch works for me. Thanks for the fix.

 Thanks Sachin.

 Hi Grant,

 I assume you would fold this change into the original patch. But if you want
 a separate patch, please let me know.

 Thanks,
 Kevin

FWIW, On Exynos platform
Tested-by: Sachin Kamat sachin.ka...@linaro.org


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] regulator: max14577: Fix invalid return value on DT parse success

2014-02-21 Thread Sachin Kamat
Hi Krzysztof,

On 20 February 2014 20:49, Krzysztof Kozlowski k.kozlow...@samsung.com wrote:
 This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
 of_node_put). The DTS parsing function returned number of matched
 regulators as success status which then was compared against 0 in probe.

 Result was a probe fail after successful parsing the DTS:
 max14577-regulator: probe of max14577-regulator failed with error 2

 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 ---
  drivers/regulator/max14577.c |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/drivers/regulator/max14577.c b/drivers/regulator/max14577.c
 index 186df8785a91..6ba11a8dd23d 100644
 --- a/drivers/regulator/max14577.c
 +++ b/drivers/regulator/max14577.c
 @@ -168,11 +168,13 @@ static int max14577_regulator_dt_parse_pdata(struct 
 platform_device *pdev)
 MAX14577_REG_MAX);
 if (ret  0) {
 dev_err(pdev-dev, Error parsing regulator init data: 
 %d\n, ret);
 +   of_node_put(np);
 +   return ret;
 }

 of_node_put(np);

 -   return ret;
 +   return 0;
  }

Instead of so many changes here, you could simply make the following change
in the max14577_regulator_probe function.

ret = max14577_regulator_dt_parse_pdata(pdev);
if (ret  0)
return ret;

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] regulator: max14577: Fix invalid return value on DT parse success

2014-02-21 Thread Sachin Kamat
On 21 February 2014 16:12, Krzysztof Kozlowski k.kozlow...@samsung.com wrote:
 On Fri, 2014-02-21 at 15:54 +0530, Sachin Kamat wrote:
 Hi Krzysztof,

 On 20 February 2014 20:49, Krzysztof Kozlowski k.kozlow...@samsung.com 
 wrote:
  This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
  of_node_put). The DTS parsing function returned number of matched
  regulators as success status which then was compared against 0 in probe.
 
  Result was a probe fail after successful parsing the DTS:
  max14577-regulator: probe of max14577-regulator failed with error 2
 
  Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
  ---
   drivers/regulator/max14577.c |4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/regulator/max14577.c b/drivers/regulator/max14577.c
  index 186df8785a91..6ba11a8dd23d 100644
  --- a/drivers/regulator/max14577.c
  +++ b/drivers/regulator/max14577.c
  @@ -168,11 +168,13 @@ static int max14577_regulator_dt_parse_pdata(struct 
  platform_device *pdev)
  MAX14577_REG_MAX);
  if (ret  0) {
  dev_err(pdev-dev, Error parsing regulator init data: 
  %d\n, ret);
  +   of_node_put(np);
  +   return ret;
  }
 
  of_node_put(np);
 
  -   return ret;
  +   return 0;
   }

 Instead of so many changes here, you could simply make the following change
 in the max14577_regulator_probe function.

 ret = max14577_regulator_dt_parse_pdata(pdev);
 if (ret  0)
 return ret;

 That still wouldn't be sufficient because later in probe() the 'ret' is
 not reassigned (if devm_regulator_register succeeds) and it is directly
 returned at the probe() end. So still the number of matched regulators
 would be returned as probe result.

Ah, you are right. In that case how about the following:

-  if (ret  0) {
+ if (ret  0)
  dev_err(pdev-dev, Error parsing regulator init data: %d\n, ret);
-  }
+ else
+  ret = 0;

I am just trying to see if we can avoid any code duplication.
-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 3/3] Documentation: mfd: Add binding document for S2MPA01

2014-02-21 Thread Sachin Kamat
On 13 February 2014 12:07, Sachin Kamat sachin.ka...@linaro.org wrote:
 Added initial binding documentation for S2MPA01 MFD.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
 Changes since v2:
 * Re-worded as suggested by Mark Rutland
 ---
  Documentation/devicetree/bindings/mfd/s2mpa01.txt |   90 
 +
  1 file changed, 90 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt


Mark,
Any comments on this patch?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] regulator: max14577: Fix invalid return value on DT parse success

2014-02-21 Thread Sachin Kamat
On 21 February 2014 17:42, Krzysztof Kozlowski k.kozlow...@samsung.com wrote:
 This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
 of_node_put). The DTS parsing function returned number of matched
 regulators as success status which then was compared against 0 in probe.

 Result was a probe fail after successful parsing the DTS:
 max14577-regulator: probe of max14577-regulator failed with error 2

 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com
 Cc: Sachin Kamat sachin.ka...@linaro.org

Looks good.
Reviewed-by: Sachin Kamat sachin.ka...@linaro.org


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 1/3] ARM: EXYNOS: Add support for EXYNOS5410 SoC

2014-02-10 Thread Sachin Kamat
Hi Tarek,

Nothing in specific about the patch, but to just make you aware that
some clean up
patches haves been proposed which might cause conflicts with this patch. Please
see inline for details.

On 10 February 2014 15:38, Tarek Dakhran t.dakh...@samsung.com wrote:
 EXYNOS5410 is SoC in Samsung's Exynos5 SoC series.
 Add initial support for this SoC.

 Signed-off-by: Tarek Dakhran t.dakh...@samsung.com
 Signed-off-by: Vyacheslav Tyrtov v.tyr...@samsung.com
 Reviewed-by: Tomasz Figa t.f...@samsung.com
 ---
  arch/arm/mach-exynos/Kconfig |   10 ++
  arch/arm/mach-exynos/common.c|   18 ++
  arch/arm/mach-exynos/include/mach/map.h  |1 +
  arch/arm/mach-exynos/mach-exynos5-dt.c   |1 +
  arch/arm/mach-exynos/platsmp.c   |2 ++
  arch/arm/plat-samsung/include/plat/cpu.h |8 
  arch/arm/plat-samsung/include/plat/map-s5p.h |3 +++
  7 files changed, 43 insertions(+)

 diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
 index 4c414af..97a06c3 100644
 --- a/arch/arm/mach-exynos/Kconfig
 +++ b/arch/arm/mach-exynos/Kconfig
 @@ -91,6 +91,16 @@ config SOC_EXYNOS5250
 help
   Enable EXYNOS5250 SoC support

 +config SOC_EXYNOS5410
 +   bool SAMSUNG EXYNOS5410
 +   default y
 +   depends on ARCH_EXYNOS5
 +   select PM_GENERIC_DOMAINS if PM
 +   select S5P_PM if PM_SLEEP
 +   select S5P_SLEEP if PM_SLEEP
 +   help
 + Enable EXYNOS5410 SoC support
 +

Per SoC Kconfig entries are proposed to be removed. Please see [1].

  config SOC_EXYNOS5420
 bool SAMSUNG EXYNOS5420
 default y
 diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
 index f18be40..f1483bd 100644
 --- a/arch/arm/mach-exynos/common.c
 +++ b/arch/arm/mach-exynos/common.c
 @@ -52,6 +52,7 @@ static const char name_exynos4210[] = EXYNOS4210;
  static const char name_exynos4212[] = EXYNOS4212;
  static const char name_exynos4412[] = EXYNOS4412;
  static const char name_exynos5250[] = EXYNOS5250;
 +static const char name_exynos5410[] = EXYNOS5410;
  static const char name_exynos5420[] = EXYNOS5420;
  static const char name_exynos5440[] = EXYNOS5440;

 @@ -85,6 +86,12 @@ static struct cpu_table cpu_ids[] __initdata = {
 .init   = exynos_init,
 .name   = name_exynos5250,
 }, {
 +   .idcode = EXYNOS5410_SOC_ID,
 +   .idmask = EXYNOS5_SOC_MASK,
 +   .map_io = exynos5_map_io,
 +   .init   = exynos_init,
 +   .name   = name_exynos5410,
 +   }, {

This is also proposed to be removed. Please see [2].

[1] http://comments.gmane.org/gmane.linux.kernel.samsung-soc/26800
[2] http://comments.gmane.org/gmane.linux.kernel.samsung-soc/26560

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mfd: MAX6650/6651 support

2014-02-10 Thread Sachin Kamat
Hi Laszlo,

If you are considering re-spinning this patch based on Lee's comments, please
also consider my comments inline.

On 8 February 2014 17:03, Laszlo Papp lp...@kde.org wrote:
 MAX6650/MAX6651 chip is a multi-function device with I2C busses. The
 chip includes fan-speed regulators and monitors, GPIO, and alarm.

 This patch is an initial release of a MAX6650/6651 MFD driver that
 supports to enable the chip with its primary I2C bus that will connect
 the hwmon, and then the gpio devices for now.

 Signed-off-by: Laszlo Papp lp...@kde.org
 ---
  drivers/mfd/Kconfig | 11 +
  drivers/mfd/Makefile|  1 +
  drivers/mfd/max665x.c   | 88 
 +
  include/linux/mfd/max665x-private.h | 42 ++
  4 files changed, 142 insertions(+)
  create mode 100644 drivers/mfd/max665x.c
  create mode 100644 include/linux/mfd/max665x-private.h

 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
 index 49bb445..e25be62 100644
 --- a/drivers/mfd/Kconfig
 +++ b/drivers/mfd/Kconfig
 @@ -368,6 +368,17 @@ config MFD_MAX8907
   accessing the device; additional drivers must be enabled in order
   to use the functionality of the device.

 +config MFD_MAX665X
 +   bool Maxim Semiconductor MAX6650/MAX6651 Support
 +   select MFD_CORE
 +   depends on I2C
 +   select REGMAP_I2C

Move the depends on before the select MFD_CORE.

 +   help
 + Say yes here to support for Maxim Semiconductor MAX6650/MAX6651.

 s/here to support/here to add support

This is
 + a fan speed regulator and monitor IC. This driver provies common 
 support
 + for accessing the device, additional drivers must be enabled in 
 order to
 + use the functionality of the device.
 +
  config MFD_MAX8925
 bool Maxim Semiconductor MAX8925 PMIC Support
 depends on I2C=y
 diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
 index 5aea5ef..63668c5 100644
 --- a/drivers/mfd/Makefile
 +++ b/drivers/mfd/Makefile
 @@ -111,6 +111,7 @@ obj-$(CONFIG_MFD_DA9055)+= da9055.o
  da9063-objs:= da9063-core.o da9063-irq.o da9063-i2c.o
  obj-$(CONFIG_MFD_DA9063)   += da9063.o

 +obj-$(CONFIG_MFD_MAX665X)  += max665x.o
  obj-$(CONFIG_MFD_MAX14577) += max14577.o
  obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o
  obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
 diff --git a/drivers/mfd/max665x.c b/drivers/mfd/max665x.c
 new file mode 100644
 index 000..395373fe
 --- /dev/null
 +++ b/drivers/mfd/max665x.c
 @@ -0,0 +1,88 @@
 +/*
 + * Device access for MAX6650-MAX6651
 + *
 + * Copyright(c) 2013 Polatis Ltd.
 + *
 + * Author: Laszlo Papp laszlo.p...@polatis.com
 + *
 + *  This program is free software; you can redistribute  it and/or modify it
 + *  under  the terms of  the GNU General  Public License as published by the
 + *  Free Software Foundation;  either version 2 of the  License, or (at your
 + *  option) any later version.
 + */
 +
 +#include linux/device.h
 +#include linux/mfd/core.h
 +#include linux/module.h
 +#include linux/i2c.h

Please arrange these alphabetically.

[snip]
 +
 +struct max665x_dev {
 +   struct device *dev;
 +   struct mutex iolock;
 +
 +   struct i2c_client *i2c;
 +   struct regmap *map;
 +
 +   int type;

Unnecessary extra lines above could be removed.


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mfd: MAX6650/6651 support

2014-02-10 Thread Sachin Kamat
On 10 February 2014 17:51, Lee Jones lee.jo...@linaro.org wrote:
  +#include linux/device.h
  +#include linux/mfd/core.h
  +#include linux/module.h
  +#include linux/i2c.h

 Please arrange these alphabetically.

 Why?

1. It makes it easier to avoid adding duplicate includes.
2. Code looks more ordered/organized.
3. Prevents further clean up patches arranging them so :)

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mfd: MAX6650/6651 support

2014-02-10 Thread Sachin Kamat
On 10 February 2014 18:48, Laszlo Papp lp...@kde.org wrote:
 On Mon, Feb 10, 2014 at 12:02 PM, Sachin Kamat sachin.ka...@linaro.org 
 wrote:
 Hi Laszlo,

 If you are considering re-spinning this patch based on Lee's comments, please
 also consider my comments inline.

 Hi, sure, thanks.

 On 8 February 2014 17:03, Laszlo Papp lp...@kde.org wrote:
 MAX6650/MAX6651 chip is a multi-function device with I2C busses. The
 chip includes fan-speed regulators and monitors, GPIO, and alarm.

 This patch is an initial release of a MAX6650/6651 MFD driver that
 supports to enable the chip with its primary I2C bus that will connect
 the hwmon, and then the gpio devices for now.

 Signed-off-by: Laszlo Papp lp...@kde.org
 ---
  drivers/mfd/Kconfig | 11 +
  drivers/mfd/Makefile|  1 +
  drivers/mfd/max665x.c   | 88 
 +
  include/linux/mfd/max665x-private.h | 42 ++
  4 files changed, 142 insertions(+)
  create mode 100644 drivers/mfd/max665x.c
  create mode 100644 include/linux/mfd/max665x-private.h

 diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
 index 49bb445..e25be62 100644
 --- a/drivers/mfd/Kconfig
 +++ b/drivers/mfd/Kconfig
 @@ -368,6 +368,17 @@ config MFD_MAX8907
   accessing the device; additional drivers must be enabled in order
   to use the functionality of the device.

 +config MFD_MAX665X
 +   bool Maxim Semiconductor MAX6650/MAX6651 Support
 +   select MFD_CORE
 +   depends on I2C
 +   select REGMAP_I2C

 Move the depends on before the select MFD_CORE.

 OK.

 +   help
 + Say yes here to support for Maxim Semiconductor MAX6650/MAX6651.

  s/here to support/here to add support

 OK.

This is
 + a fan speed regulator and monitor IC. This driver provies common 
 support
 + for accessing the device, additional drivers must be enabled in 
 order to
 + use the functionality of the device.
 +
  config MFD_MAX8925
 bool Maxim Semiconductor MAX8925 PMIC Support
 depends on I2C=y
 diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
 index 5aea5ef..63668c5 100644
 --- a/drivers/mfd/Makefile
 +++ b/drivers/mfd/Makefile
 @@ -111,6 +111,7 @@ obj-$(CONFIG_MFD_DA9055)+= da9055.o
  da9063-objs:= da9063-core.o da9063-irq.o da9063-i2c.o
  obj-$(CONFIG_MFD_DA9063)   += da9063.o

 +obj-$(CONFIG_MFD_MAX665X)  += max665x.o
  obj-$(CONFIG_MFD_MAX14577) += max14577.o
  obj-$(CONFIG_MFD_MAX77686) += max77686.o max77686-irq.o
  obj-$(CONFIG_MFD_MAX77693) += max77693.o max77693-irq.o
 diff --git a/drivers/mfd/max665x.c b/drivers/mfd/max665x.c
 new file mode 100644
 index 000..395373fe
 --- /dev/null
 +++ b/drivers/mfd/max665x.c
 @@ -0,0 +1,88 @@
 +/*
 + * Device access for MAX6650-MAX6651
 + *
 + * Copyright(c) 2013 Polatis Ltd.
 + *
 + * Author: Laszlo Papp laszlo.p...@polatis.com
 + *
 + *  This program is free software; you can redistribute  it and/or modify 
 it
 + *  under  the terms of  the GNU General  Public License as published by 
 the
 + *  Free Software Foundation;  either version 2 of the  License, or (at 
 your
 + *  option) any later version.
 + */
 +
 +#include linux/device.h
 +#include linux/mfd/core.h
 +#include linux/module.h
 +#include linux/i2c.h

 Please arrange these alphabetically.

 OK, it does not matter for me. Please agree upon something with Lee. :-)


 [snip]
 +
 +struct max665x_dev {
 +   struct device *dev;
 +   struct mutex iolock;
 +
 +   struct i2c_client *i2c;
 +   struct regmap *map;
 +
 +   int type;

 Unnecessary extra lines above could be removed.

 I prefer it that way, but I will remove the two extra lines as you wish.

As I already said, these are just nits and only since you were
re-spinning the patch,
I suggested them. Also, since this is a new file being added, it
avoids further patches
doing these same things.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 0/1] Boot all secondary cores on Exynos SoC's

2014-02-10 Thread Sachin Kamat
Hi Tarek,

On 11 February 2014 07:45, Tarek Dakhran t.dakh...@samsung.com wrote:
 Due to implementation of exynos_boot_secondary function
 only one secondary core boots on Exynos SoC's.

Even without this patch I could boot the secondary CPUs on Exynos4210, 4412 and
5250 based boards with the latest Linux kernel (v3.14-rc2+). Is this
patch required for
a specific use case or am I missing something?

---
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 0/1] Boot all secondary cores on Exynos SoC's

2014-02-11 Thread Sachin Kamat
Hi Tarek,

On 11 February 2014 12:56, Tarek Dakhran t.dakh...@samsung.com wrote:
 Hi Sachin,



 Current implementation allow to boot only one secondary core.

 This patch makes possible to boot 4 cores on Exynos5420 and Exynos5410 SoC's

I also get 4 cores up with the mainline kernel on SMDK 5420 board
without this patch.
Please see log below:

[0.00] Linux version 3.14.0-rc2-00027-gce8ee8a (sachin@linaro)
(gcc version 4.8.2 20130805 (prerelease) (crosstool-NG linaro-1
.13.1-4.8-2013.08 - Linaro GCC 2013.08) ) #76 SMP PREEMPT Tue Feb 11
15:18:30 IST 2014
[0.00] CPU: ARMv7 Processor [412fc0f3] revision 3 (ARMv7), cr=10c5387d
[0.00] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[0.00] Machine model: Samsung SMDK5420 board based on EXYNOS5420
[0.00] NR_BANKS too low, ignoring high memory
[0.00] Memory policy: Data cache writealloc
[0.00] CPU EXYNOS5420 (id 0xe5420200)
[0.00] On node 0 totalpages: 522240
[0.00]   Normal zone: 1520 pages used for memmap
[0.00]   Normal zone: 0 pages reserved
[0.00]   Normal zone: 194560 pages, LIFO batch:31
[0.00]   HighMem zone: 2576 pages used for memmap
[0.00]   HighMem zone: 327680 pages, LIFO batch:31
[0.00] PERCPU: Embedded 7 pages/cpu @ee795000 s7424 r8192 d13056 u32768
[0.00] pcpu-alloc: s7424 r8192 d13056 u32768 alloc=8*4096
[0.00] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
[0.00] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 520720
[0.00] Kernel command line: root=/dev/mmcblk1p1 rw rootwait
console=ttySAC2,115200n8 init=/linuxrc earlyprintk loglevel=8 no_c
onsole_suspend
[0.00] PID hash table entries: 4096 (order: 2, 16384 bytes)
[0.00] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[0.00] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[0.00] Memory: 2065876K/2088960K available (3705K kernel code,
227K rwdata, 1124K rodata, 223K init, 263K bss, 23084K reserved
, 1310720K highmem)
[0.00] Virtual kernel memory layout:
[0.00] vector  : 0x - 0x1000   (   4 kB)
[0.00] fixmap  : 0xfff0 - 0xfffe   ( 896 kB)
[0.00] vmalloc : 0xf000 - 0xff00   ( 240 MB)
[0.00] lowmem  : 0xc000 - 0xef80   ( 760 MB)
[0.00] pkmap   : 0xbfe0 - 0xc000   (   2 MB)
[0.00] modules : 0xbf00 - 0xbfe0   (  14 MB)
[0.00]   .text : 0xc0008000 - 0xc04bf6e8   (4830 kB)
[0.00]   .init : 0xc04c - 0xc04f7d00   ( 224 kB)
[0.00]   .data : 0xc04f8000 - 0xc0530e80   ( 228 kB)
[0.00].bss : 0xc0530e8c - 0xc0572e34   ( 264 kB)
[0.00] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[0.00] Preemptible hierarchical RCU implementation.
[0.00] NR_IRQS:16 nr_irqs:16 16
[0.00] sched_clock: 32 bits at 200 Hz, resolution 500ns,
wraps every 1073741824000ns
[0.00] Console: colour dummy device 80x30
[0.045000] Calibrating delay loop... 1590.88 BogoMIPS (lpj=3977216)
[0.045000] pid_max: default: 32768 minimum: 301
[0.045000] Mount-cache hash table entries: 512
[0.055000] CPU: Testing write buffer coherency: ok
[0.055000] CPU0: update cpu_power 1535
[0.055000] CPU0: thread -1, cpu 0, socket 0, mpidr 8000
[0.055000] Setting up static identity map for 0x20387210 - 0x20387268
[0.075000] CPU1: Booted secondary processor
[0.125000] CPU1: update cpu_power 1535
[0.125000] CPU1: thread -1, cpu 1, socket 0, mpidr 8001
[0.135000] CPU2: Booted secondary processor
[0.175000] CPU2: update cpu_power 1535
[0.175000] CPU2: thread -1, cpu 2, socket 0, mpidr 8002
[0.185000] CPU3: Booted secondary processor
[0.235000] CPU3: update cpu_power 1535
[0.235000] CPU3: thread -1, cpu 3, socket 0, mpidr 8003
[1.245000] CPU4: failed to boot: -38
[2.245000] CPU5: failed to boot: -38
[3.255000] CPU6: failed to boot: -38
[4.255000] CPU7: failed to boot: -38
[4.255000] Brought up 4 CPUs
[4.255000] SMP: Total of 4 processors activated.


Regards,
Sachin


 On Tue, Feb 11, 2014 at 3:17 PM, Sachin Kamat sachin.ka...@linaro.org
 wrote:

Hi Tarek,


 On 11 February 2014 07:45, Tarek Dakhran t.dakh...@samsung.com wrote:
 Due to implementation of exynos_boot_secondary function
 only one secondary core boots on Exynos SoC's.

Even without this patch I could boot the secondary CPUs on Exynos4210, 4412
 and
5250 based boards with the latest Linux kernel (v3.14-rc2+). Is this
patch required for
a specific use case or am I missing something?

---
With warm regards,
Sachin



 Best regards,

 Tarek Dakhran



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord

Re: [PATCH v2] mfd: MAX6650/6651 support

2014-02-11 Thread Sachin Kamat
On 11 February 2014 15:40, Laszlo Papp lp...@kde.org wrote:
 [snip]
 +
 +struct max665x_dev {
 +   struct device *dev;
 +   struct mutex iolock;
 +
 +   struct i2c_client *i2c;
 +   struct regmap *map;
 +
 +   int type;

 Unnecessary extra lines above could be removed.

 I prefer it that way, but I will remove the two extra lines as you wish.

 As I already said, these are just nits and only since you were
 re-spinning the patch,
 I suggested them. Also, since this is a new file being added, it
 avoids further patches
 doing these same things.

 Well, it is worse in my opinion because it makes the code more bloated
 without separation between units, but I made the requested change
 anyway because the feature matters lotta more to me than this styling.
 Hope it is OK now?

The only thing that you missed among what you agreed to change is the
arrangement of
depends on and select in Kconfig. Rest look OK. Thanks for taking care.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] mfd: MAX6650/6651 support

2014-02-11 Thread Sachin Kamat
On 11 February 2014 17:09, Laszlo Papp lp...@kde.org wrote:
 On Tue, Feb 11, 2014 at 11:14 AM, Sachin Kamat sachin.ka...@linaro.org 
 wrote:
 On 11 February 2014 15:40, Laszlo Papp lp...@kde.org wrote:
 [snip]
 +
 +struct max665x_dev {
 +   struct device *dev;
 +   struct mutex iolock;
 +
 +   struct i2c_client *i2c;
 +   struct regmap *map;
 +
 +   int type;

 Unnecessary extra lines above could be removed.

 I prefer it that way, but I will remove the two extra lines as you wish.

 As I already said, these are just nits and only since you were
 re-spinning the patch,
 I suggested them. Also, since this is a new file being added, it
 avoids further patches
 doing these same things.

 Well, it is worse in my opinion because it makes the code more bloated
 without separation between units, but I made the requested change
 anyway because the feature matters lotta more to me than this styling.
 Hope it is OK now?

 The only thing that you missed among what you agreed to change is the
 arrangement of
 depends on and select in Kconfig. Rest look OK. Thanks for taking care.

 Ah, true. I will do that tomorrow if it is a blocker for the integration.

I don't think it is a blocker in any way and you may choose to ignore
it as well.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6] mfd: MAX6650/6651 support

2014-02-11 Thread Sachin Kamat
Hi Laszlo,

Sorry for missing out on a couple of points during my earlier review.
Please see inline.

On 12 February 2014 09:32, Laszlo Papp lp...@kde.org wrote:
 MAX6650/MAX6651 chip is a multi-function device with I2C busses. The
 chip includes fan-speed regulators and monitors, GPIO, and alarm.

 This patch is an initial release of a MAX6650/6651 MFD driver that
 supports to enable the chip with its primary I2C bus that will connect
 the hwmon, and then the gpio devices for now.

 Signed-off-by: Laszlo Papp lp...@kde.org
 ---
[snip]

 --- /dev/null
 +++ b/drivers/mfd/max665x.c
 @@ -0,0 +1,87 @@
 +/*
 + * Device access for MAX6650-MAX6651
 + *
 + * Copyright(c) 2013 Polatis Ltd.
 + *
 + * Author: Laszlo Papp laszlo.p...@polatis.com
 + *
 + *  This program is free software; you can redistribute  it and/or modify it
 + *  under  the terms of  the GNU General  Public License as published by the
 + *  Free Software Foundation;  either version 2 of the  License, or (at your
 + *  option) any later version.
 + */
 +
 +#include linux/device.h
 +#include linux/mfd/core.h
 +#include linux/module.h
 +#include linux/i2c.h
 +
 +#include linux/mfd/max665x-private.h
 +
 +static struct mfd_cell max665x_devs[] = {
 +   { .name = max6651-gpio, },
 +   { .name = max6650, }, /* hwmon driver */
 +   {},
 +};
 +
 +const struct regmap_config max665x_regmap_config = {
 +   .reg_bits = 5,
 +};

This should be static.

 +static int max665x_probe(struct i2c_client *i2c,
 +   const struct i2c_device_id *id)
 +{
 +   struct max665x_dev *max665x;
 +   int ret;
 +
 +   max665x = devm_kzalloc(i2c-dev, sizeof(*max665x), GFP_KERNEL);
 +   if (!max665x)
 +   return -ENOMEM;
 +
 +   i2c_set_clientdata(i2c, max665x);
 +   max665x-dev = i2c-dev;
 +   max665x-i2c = i2c;
 +   max665x-map = devm_regmap_init_i2c(i2c, max665x_regmap_config);

Don't you need to check the return value of devm_regmap_init_i2c?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] mfd: stw481x: Staticize stw481x_regmap_config

2014-02-12 Thread Sachin Kamat
stw481x_regmap_config is local to this file.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Linus Walleij linus.wall...@linaro.org
---
 drivers/mfd/stw481x.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/stw481x.c b/drivers/mfd/stw481x.c
index 1243d5c6a448..cc42f88586f6 100644
--- a/drivers/mfd/stw481x.c
+++ b/drivers/mfd/stw481x.c
@@ -167,7 +167,7 @@ static struct mfd_cell stw481x_cells[] = {
},
 };
 
-const struct regmap_config stw481x_regmap_config = {
+static const struct regmap_config stw481x_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
 };
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] mfd: wm8400-core: Remove unnecessary goto

2014-02-12 Thread Sachin Kamat
Return directly to avoid redundant lines of code.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/mfd/wm8400-core.c |   22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index d66d256551fb..8788fd1f0a83 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -161,31 +161,19 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
 {
struct wm8400 *wm8400;
-   int ret;
 
wm8400 = devm_kzalloc(i2c-dev, sizeof(struct wm8400), GFP_KERNEL);
-   if (wm8400 == NULL) {
-   ret = -ENOMEM;
-   goto err;
-   }
+   if (wm8400 == NULL)
+   return -ENOMEM;
 
wm8400-regmap = devm_regmap_init_i2c(i2c, wm8400_regmap_config);
-   if (IS_ERR(wm8400-regmap)) {
-   ret = PTR_ERR(wm8400-regmap);
-   goto err;
-   }
+   if (IS_ERR(wm8400-regmap))
+   return PTR_ERR(wm8400-regmap);
 
wm8400-dev = i2c-dev;
i2c_set_clientdata(i2c, wm8400);
 
-   ret = wm8400_init(wm8400, dev_get_platdata(i2c-dev));
-   if (ret != 0)
-   goto err;
-
-   return 0;
-
-err:
-   return ret;
+   return wm8400_init(wm8400, dev_get_platdata(i2c-dev));
 }
 
 static int wm8400_i2c_remove(struct i2c_client *i2c)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] mfd: stw481x: Check the return value of devm_regmap_init_i2c

2014-02-12 Thread Sachin Kamat
devm_regmap_init_i2c can fail. Check for it.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Linus Walleij linus.wall...@linaro.org
---
 drivers/mfd/stw481x.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/stw481x.c b/drivers/mfd/stw481x.c
index cc42f88586f6..7ceb3df09e25 100644
--- a/drivers/mfd/stw481x.c
+++ b/drivers/mfd/stw481x.c
@@ -186,6 +186,12 @@ static int stw481x_probe(struct i2c_client *client,
i2c_set_clientdata(client, stw481x);
stw481x-client = client;
stw481x-map = devm_regmap_init_i2c(client, stw481x_regmap_config);
+   if (IS_ERR(stw481x-map)) {
+   ret = PTR_ERR(stw481x-map);
+   dev_err(client-dev, Failed to allocate register map: %d\n,
+   ret);
+   return ret;
+   }
 
ret = stw481x_startup(stw481x);
if (ret) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] mfd: max14577: Include missing err.h

2014-02-12 Thread Sachin Kamat
Add this header explicitly for IS_ERR and friends.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/mfd/max14577.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index 2ac2f2d7cea6..88cf5811ce3b 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -18,6 +18,7 @@
  * This driver is based on max8997.c
  */
 
+#include linux/err.h
 #include linux/module.h
 #include linux/interrupt.h
 #include linux/mfd/core.h
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/3] Documentation: mfd: Add binding document for S2MPA01

2014-02-12 Thread Sachin Kamat
On 9 January 2014 16:52, Sachin Kamat sachin.ka...@linaro.org wrote:
 Added initial binding documentation for S2MPA01 MFD.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
 * Re-organised as suggested by Mark Rutland.
 ---
  Documentation/devicetree/bindings/mfd/s2mpa01.txt |   86 
 +
  1 file changed, 86 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt

 diff --git a/Documentation/devicetree/bindings/mfd/s2mpa01.txt 
 b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
 new file mode 100644
 index ..70879b92b24b
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
 @@ -0,0 +1,86 @@
 +
 +* Samsung S2MPA01 Voltage and Current Regulator
 +
 +The Samsung S2MPA01 is a multi-function device which includes high
 +efficiency buck converters including Dual-Phase buck converter, various LDOs,
 +and an RTC. It is interfaced to the host controller using an I2C interface.
 +Each sub-block is addressed by the host system using different I2C slave
 +addresses.
 +
 +Required properties:
 +- compatible: Should be samsung,s2mpa01-pmic.
 +- reg: Specifies the I2C slave address of the PMIC block. It should be 0x66.
 +
 +Optional properties:
 +- interrupt-parent: Specifies the phandle of the interrupt controller to 
 which
 +  the interrupts from s2mpa01 are delivered to.
 +- interrupts: Interrupt specifier for interrupt source (connected to SoC).
 +
 +Optional nodes:
 +- regulators: The regulators of s2mpa01 that have to be instantiated should 
 be
 +  included in a sub-node named 'regulators'. Regulator nodes and constraints
 +  included in this sub-node use the standard regulator bindings which are
 +  documented elsewhere.
 +
 +Properties for BUCK regulator nodes:
 + regulator-ramp-delay for BUCKs = [6250/12500(default)/25000/5] uV/us
 +
 + BUCK[1/2/3/4] supports disabling ramp delay on hardware, so explictly
 + regulator-ramp-delay = 0 can be used for them to disable ramp delay.
 + In the absence of the regulator-ramp-delay property, the default ramp
 + delay will be used.
 +
 +  NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be 
 set
 +  for a particular group of BUCKs. So provide same 
 regulator-ramp-delayvalue.
 +  Grouping of BUCKs sharing ramp rate setting is as follow : BUCK[1, 6],
 +  BUCK[2, 4], and BUCK[8, 9, 10]
 +
 +The following are the names of the regulators that the s2mpa01 PMIC block
 +supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
 +as per the datasheet of s2mpa01.
 +
 +   - LDOn
 + - valid values for n are 1 to 26
 + - Example: LDO1, LD02, LDO26
 +   - BUCKn
 + - valid values for n are 1 to 10.
 + - Example: BUCK1, BUCK2, BUCK9
 +
 +Example:
 +
 +   s2mpa01_pmic@66 {
 +   compatible = samsung,s2mpa01-pmic;
 +   reg = 0x66;
 +
 +   regulators {
 +   ldo1_reg: LDO1 {
 +   regulator-name = VDD_ALIVE;
 +   regulator-min-microvolt = 100;
 +   regulator-max-microvolt = 100;
 +   };
 +
 +   ldo2_reg: LDO2 {
 +   regulator-name = VDDQ_MMC2;
 +   regulator-min-microvolt = 280;
 +   regulator-max-microvolt = 280;
 +   regulator-always-on;
 +   };
 +
 +   buck1_reg: BUCK1 {
 +   regulator-name = vdd_mif;
 +   regulator-min-microvolt = 95;
 +   regulator-max-microvolt = 135;
 +   regulator-always-on;
 +   regulator-boot-on;
 +   };
 +
 +   buck2_reg: BUCK2 {
 +   regulator-name = vdd_arm;
 +   regulator-min-microvolt = 95;
 +   regulator-max-microvolt = 135;
 +   regulator-always-on;
 +   regulator-boot-on;
 +   regulator-ramp-delay = 5;
 +   };
 +   };
 +   };
 --
 1.7.9.5


Can I please have an ack from the DT maintainers so that this series
can be picked by Lee.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] ARM: S3C24XX: Fix typo CONFIG_CPUS_3C2443

2014-02-12 Thread Sachin Kamat
On 12 February 2014 15:11, Paul Bolle pebo...@tiscali.nl wrote:
 Signed-off-by: Paul Bolle pebo...@tiscali.nl
 ---
 Untested. This needs testing by people with access to knowledge,
 compilers, and/or hardware related to CPU_S3C2443. I'm not one of them.

  arch/arm/mach-s3c24xx/common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
 index 4adaa4b..1d77d70 100644
 --- a/arch/arm/mach-s3c24xx/common.c
 +++ b/arch/arm/mach-s3c24xx/common.c
 @@ -484,7 +484,7 @@ struct platform_device s3c2440_device_dma = {
  };
  #endif

 -#if defined(CONFIG_CPUS_3C2443) || defined(CONFIG_CPU_S3C2416)
 +#if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)

This is definitely a typo and the current fix looks good.

Reviewed-by: Sachin Kamat sachin.ka...@linaro.org

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/3] regulator: Add support for S2MPA01 regulator

2014-02-12 Thread Sachin Kamat
On 12 February 2014 23:32, Mark Rutland mark.rutl...@arm.com wrote:
 On Thu, Jan 09, 2014 at 11:22:33AM +, Sachin Kamat wrote:
 Add support for S2MPA01 voltage and current regulator.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
 * Addressed comments from Mark Brown
  - Used module_platform_driver instead of subsys init call
 ---
  drivers/regulator/Kconfig   |7 +
  drivers/regulator/Makefile  |1 +
  drivers/regulator/s2mpa01.c |  482 
 +++
  3 files changed, 490 insertions(+)
  create mode 100644 drivers/regulator/s2mpa01.c

 [...]

 +static int s2mpa01_pmic_probe(struct platform_device *pdev)
 +{
 +   struct sec_pmic_dev *iodev = dev_get_drvdata(pdev-dev.parent);
 +   struct sec_platform_data *pdata = dev_get_platdata(iodev-dev);
 +   struct of_regulator_match rdata[S2MPA01_REGULATOR_MAX];
 +   struct device_node *reg_np = NULL;
 +   struct regulator_config config = { };
 +   struct s2mpa01_info *s2mpa01;
 +   int i, ret;
 +
 +   s2mpa01 = devm_kzalloc(pdev-dev, sizeof(*s2mpa01), GFP_KERNEL);
 +   if (!s2mpa01)
 +   return -ENOMEM;
 +
 +   for (i = 0; i  S2MPA01_REGULATOR_CNT; i++)
 +   rdata[i].name = regulators[i].name;
 +
 +   if (iodev-dev-of_node) {
 +   reg_np = of_find_node_by_name(iodev-dev-of_node,
 +   regulators);

 This walks the allnodes list, and can thus walk outside of the parent
 node.

 Use of_get_child_by_name instead.

OK.


 +   if (!reg_np) {
 +   dev_err(pdev-dev,
 +   could not find regulators 
 sub-node\n);
 +   return -EINVAL;
 +   }
 +
 +   of_regulator_match(pdev-dev, reg_np, rdata,
 +   S2MPA01_REGULATOR_MAX);

 Is a reference to reg_np held beyond this? Do you need an
 of_node_put(reg_np)?

Yes, you are right.

Thanks for the review.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/3] Documentation: mfd: Add binding document for S2MPA01

2014-02-12 Thread Sachin Kamat
Hi Mark,

On 12 February 2014 23:40, Mark Rutland mark.rutl...@arm.com wrote:
 Hi Sachin,

 Apologies for the delay on this.

No problem :). Thank you for your review. Please see my comments inline.


 On Thu, Jan 09, 2014 at 11:22:34AM +, Sachin Kamat wrote:
 Added initial binding documentation for S2MPA01 MFD.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
 * Re-organised as suggested by Mark Rutland.
 ---
  Documentation/devicetree/bindings/mfd/s2mpa01.txt |   86 
 +
  1 file changed, 86 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt

 diff --git a/Documentation/devicetree/bindings/mfd/s2mpa01.txt 
 b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
 new file mode 100644
 index ..70879b92b24b
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
 @@ -0,0 +1,86 @@
 +
 +* Samsung S2MPA01 Voltage and Current Regulator
 +
 +The Samsung S2MPA01 is a multi-function device which includes high
 +efficiency buck converters including Dual-Phase buck converter, various 
 LDOs,
 +and an RTC. It is interfaced to the host controller using an I2C interface.
 +Each sub-block is addressed by the host system using different I2C slave
 +addresses.
 +
 +Required properties:
 +- compatible: Should be samsung,s2mpa01-pmic.
 +- reg: Specifies the I2C slave address of the PMIC block. It should be 0x66.

 Is the slave address not per-instance in I2C? If not why must is be 0x66?

Mark Brown already replied to this. Thanks Mark.


 +
 +Optional properties:
 +- interrupt-parent: Specifies the phandle of the interrupt controller to 
 which
 +  the interrupts from s2mpa01 are delivered to.
 +- interrupts: Interrupt specifier for interrupt source (connected to SoC).

 The part in brackets can go. Assuming this is a single interrupt:

OK.


 - interrupts: An interrupt-specifier for the sole interrupt generated by
   the device.

 If the interrupt has a name it would be nice to mention that. If there
 are more than one you should describe them.

 +
 +Optional nodes:
 +- regulators: The regulators of s2mpa01 that have to be instantiated should 
 be
 +  included in a sub-node named 'regulators'. Regulator nodes and constraints
 +  included in this sub-node use the standard regulator bindings which are
 +  documented elsewhere.
 +
 +Properties for BUCK regulator nodes:
 + regulator-ramp-delay for BUCKs = [6250/12500(default)/25000/5] uV/us

 This could be made easier to read:

 - regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500
   (default), 25, or 5. May be 0 for disabling the ramp delay on
   BUCK{1,2,3,4}.

Yes. Will update.


 +
 + BUCK[1/2/3/4] supports disabling ramp delay on hardware, so explictly
 + regulator-ramp-delay = 0 can be used for them to disable ramp delay.
 + In the absence of the regulator-ramp-delay property, the default ramp
 + delay will be used.

 Can be folded into the above, as in my example.

Right.


 +
 +  NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be 
 set
 +  for a particular group of BUCKs. So provide same 
 regulator-ramp-delayvalue.

 Missing '=' before value?

Yes. Thanks for pointing out.


 +  Grouping of BUCKs sharing ramp rate setting is as follow : BUCK[1, 6],
 +  BUCK[2, 4], and BUCK[8, 9, 10]

 The following BUCKs share ramp settings:
 * 1 and 6
 * 2 and 4
 * 8, 9, and 10

OK.
-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 3/3] Documentation: mfd: Add binding document for S2MPA01

2014-02-12 Thread Sachin Kamat
Added initial binding documentation for S2MPA01 MFD.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Changes since v2:
* Re-worded as suggested by Mark Rutland
---
 Documentation/devicetree/bindings/mfd/s2mpa01.txt |   90 +
 1 file changed, 90 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/s2mpa01.txt

diff --git a/Documentation/devicetree/bindings/mfd/s2mpa01.txt 
b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
new file mode 100644
index ..c13d3d8c3947
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/s2mpa01.txt
@@ -0,0 +1,90 @@
+
+* Samsung S2MPA01 Voltage and Current Regulator
+
+The Samsung S2MPA01 is a multi-function device which includes high
+efficiency buck converters including Dual-Phase buck converter, various LDOs,
+and an RTC. It is interfaced to the host controller using an I2C interface.
+Each sub-block is addressed by the host system using different I2C slave
+addresses.
+
+Required properties:
+- compatible: Should be samsung,s2mpa01-pmic.
+- reg: Specifies the I2C slave address of the PMIC block. It should be 0x66.
+
+Optional properties:
+- interrupt-parent: Specifies the phandle of the interrupt controller to which
+  the interrupts from s2mpa01 are delivered to.
+- interrupts: An interrupt specifier for the sole interrupt generated by the
+  device.
+
+Optional nodes:
+- regulators: The regulators of s2mpa01 that have to be instantiated should be
+  included in a sub-node named 'regulators'. Regulator nodes and constraints
+  included in this sub-node use the standard regulator bindings which are
+  documented elsewhere.
+
+Properties for BUCK regulator nodes:
+- regulator-ramp-delay: ramp delay in uV/us. May be 6250, 12500
+  (default), 25000, or 5. May be 0 for disabling the ramp delay on
+  BUCK{1,2,3,4}.
+
+ In the absence of the regulator-ramp-delay property, the default ramp
+ delay will be used.
+
+  NOTE: Some BUCKs share the ramp rate setting i.e. same ramp value will be set
+  for a particular group of BUCKs. So provide same 
regulator-ramp-delay=value.
+
+  The following BUCKs share ramp settings:
+  * 1 and 6
+  * 2 and 4
+  * 8, 9, and 10
+
+The following are the names of the regulators that the s2mpa01 PMIC block
+supports. Note: The 'n' in LDOn and BUCKn represents the LDO or BUCK number
+as per the datasheet of s2mpa01.
+
+   - LDOn
+ - valid values for n are 1 to 26
+ - Example: LDO1, LD02, LDO26
+   - BUCKn
+ - valid values for n are 1 to 10.
+ - Example: BUCK1, BUCK2, BUCK9
+
+Example:
+
+   s2mpa01_pmic@66 {
+   compatible = samsung,s2mpa01-pmic;
+   reg = 0x66;
+
+   regulators {
+   ldo1_reg: LDO1 {
+   regulator-name = VDD_ALIVE;
+   regulator-min-microvolt = 100;
+   regulator-max-microvolt = 100;
+   };
+
+   ldo2_reg: LDO2 {
+   regulator-name = VDDQ_MMC2;
+   regulator-min-microvolt = 280;
+   regulator-max-microvolt = 280;
+   regulator-always-on;
+   };
+
+   buck1_reg: BUCK1 {
+   regulator-name = vdd_mif;
+   regulator-min-microvolt = 95;
+   regulator-max-microvolt = 135;
+   regulator-always-on;
+   regulator-boot-on;
+   };
+
+   buck2_reg: BUCK2 {
+   regulator-name = vdd_arm;
+   regulator-min-microvolt = 95;
+   regulator-max-microvolt = 135;
+   regulator-always-on;
+   regulator-boot-on;
+   regulator-ramp-delay = 5;
+   };
+   };
+   };
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 2/3] regulator: Add support for S2MPA01 regulator

2014-02-12 Thread Sachin Kamat
Add support for S2MPA01 voltage and current regulator.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Acked-by: Mark Brown broo...@linaro.org
---
Changes since v2:
* Added missing of_node_put
* Used of_get_child_by_name
---
 drivers/regulator/Kconfig   |7 +
 drivers/regulator/Makefile  |1 +
 drivers/regulator/s2mpa01.c |  483 +++
 3 files changed, 491 insertions(+)
 create mode 100644 drivers/regulator/s2mpa01.c

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 6a7932822e37..8f8e6710bb45 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -416,6 +416,13 @@ config REGULATOR_RC5T583
  through regulator interface. The device supports multiple DCDC/LDO
  outputs which can be controlled by i2c communication.
 
+config REGULATOR_S2MPA01
+   tristate Samsung S2MPA01 voltage regulator
+   depends on MFD_SEC_CORE
+   help
+This driver controls Samsung S2MPA01 voltage output regulator
+via I2C bus. S2MPA01 has 10 Bucks and 26 LDO outputs.
+
 config REGULATOR_S2MPS11
tristate Samsung S2MPS11 voltage regulator
depends on MFD_SEC_CORE
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 979f9ddcf259..b3ece84289cf 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o
 obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
 obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
 obj-$(CONFIG_REGULATOR_RC5T583)  += rc5t583-regulator.o
+obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
 obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
diff --git a/drivers/regulator/s2mpa01.c b/drivers/regulator/s2mpa01.c
new file mode 100644
index ..6ac6e8205a05
--- /dev/null
+++ b/drivers/regulator/s2mpa01.c
@@ -0,0 +1,483 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd
+ * http://www.samsung.com
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ *
+ */
+
+#include linux/bug.h
+#include linux/err.h
+#include linux/gpio.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/of.h
+#include linux/regmap.h
+#include linux/platform_device.h
+#include linux/regulator/driver.h
+#include linux/regulator/machine.h
+#include linux/regulator/of_regulator.h
+#include linux/mfd/samsung/core.h
+#include linux/mfd/samsung/s2mpa01.h
+
+#define S2MPA01_REGULATOR_CNT ARRAY_SIZE(regulators)
+
+struct s2mpa01_info {
+   struct regulator_dev *rdev[S2MPA01_REGULATOR_MAX];
+
+   int ramp_delay24;
+   int ramp_delay3;
+   int ramp_delay5;
+   int ramp_delay16;
+   int ramp_delay7;
+   int ramp_delay8910;
+};
+
+static int get_ramp_delay(int ramp_delay)
+{
+   unsigned char cnt = 0;
+
+   ramp_delay /= 6250;
+
+   while (true) {
+   ramp_delay = ramp_delay  1;
+   if (ramp_delay == 0)
+   break;
+   cnt++;
+   }
+
+   if (cnt  3)
+   cnt = 3;
+
+   return cnt;
+}
+
+static int s2mpa01_regulator_set_voltage_time_sel(struct regulator_dev *rdev,
+  unsigned int old_selector,
+  unsigned int new_selector)
+{
+   struct s2mpa01_info *s2mpa01 = rdev_get_drvdata(rdev);
+   unsigned int ramp_delay = 0;
+   int old_volt, new_volt;
+
+   switch (rdev-desc-id) {
+   case S2MPA01_BUCK2:
+   case S2MPA01_BUCK4:
+   ramp_delay = s2mpa01-ramp_delay24;
+   break;
+   case S2MPA01_BUCK3:
+   ramp_delay = s2mpa01-ramp_delay3;
+   break;
+   case S2MPA01_BUCK5:
+   ramp_delay = s2mpa01-ramp_delay5;
+   break;
+   case S2MPA01_BUCK1:
+   case S2MPA01_BUCK6:
+   ramp_delay = s2mpa01-ramp_delay16;
+   break;
+   case S2MPA01_BUCK7:
+   ramp_delay = s2mpa01-ramp_delay7;
+   break;
+   case S2MPA01_BUCK8:
+   case S2MPA01_BUCK9:
+   case S2MPA01_BUCK10:
+   ramp_delay = s2mpa01-ramp_delay8910;
+   break;
+   }
+
+   if (ramp_delay == 0)
+   ramp_delay = rdev-desc-ramp_delay;
+
+   old_volt = rdev-desc-min_uV + (rdev-desc-uV_step * old_selector);
+   new_volt = rdev-desc-min_uV + (rdev-desc-uV_step * new_selector);
+
+   return DIV_ROUND_UP(abs(new_volt - old_volt), ramp_delay);
+}
+
+static int s2mpa01_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
+{
+   struct s2mpa01_info *s2mpa01 = rdev_get_drvdata(rdev);
+   unsigned int ramp_val

[PATCH v3 1/3] mfd: Add support for S2MPA01 device

2014-02-12 Thread Sachin Kamat
Add the necessary entries required for S2MPA01 multi-function
device. While at it also convert whitespaces to tabs in core.h.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Acked-by: Lee Jones lee.jo...@linaro.org
---
No change in v3 since v2.
---
 drivers/mfd/sec-core.c  |   45 +++-
 include/linux/mfd/samsung/core.h|   16 ++-
 include/linux/mfd/samsung/irq.h |   50 +
 include/linux/mfd/samsung/s2mpa01.h |  192 +++
 4 files changed, 295 insertions(+), 8 deletions(-)
 create mode 100644 include/linux/mfd/samsung/s2mpa01.h

diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index a139798b8065..564265c57fd9 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -26,6 +26,7 @@
 #include linux/mfd/samsung/core.h
 #include linux/mfd/samsung/irq.h
 #include linux/mfd/samsung/rtc.h
+#include linux/mfd/samsung/s2mpa01.h
 #include linux/mfd/samsung/s2mps11.h
 #include linux/mfd/samsung/s5m8763.h
 #include linux/mfd/samsung/s5m8767.h
@@ -69,18 +70,40 @@ static const struct mfd_cell s2mps11_devs[] = {
}
 };
 
+static const struct mfd_cell s2mpa01_devs[] = {
+   {
+   .name = s2mpa01-pmic,
+   },
+};
+
 #ifdef CONFIG_OF
 static struct of_device_id sec_dt_match[] = {
{   .compatible = samsung,s5m8767-pmic,
.data = (void *)S5M8767X,
-   },
-   {   .compatible = samsung,s2mps11-pmic,
+   }, {
+   .compatible = samsung,s2mps11-pmic,
.data = (void *)S2MPS11X,
+   }, {
+   .compatible = samsung,s2mpa01-pmic,
+   .data = (void *)S2MPA01,
+   }, {
+   /* Sentinel */
},
-   {},
 };
 #endif
 
+static bool s2mpa01_volatile(struct device *dev, unsigned int reg)
+{
+   switch (reg) {
+   case S2MPA01_REG_INT1M:
+   case S2MPA01_REG_INT2M:
+   case S2MPA01_REG_INT3M:
+   return false;
+   default:
+   return true;
+   }
+}
+
 static bool s2mps11_volatile(struct device *dev, unsigned int reg)
 {
switch (reg) {
@@ -111,6 +134,15 @@ static const struct regmap_config sec_regmap_config = {
.val_bits = 8,
 };
 
+static const struct regmap_config s2mpa01_regmap_config = {
+   .reg_bits = 8,
+   .val_bits = 8,
+
+   .max_register = S2MPA01_REG_LDO_OVCB4,
+   .volatile_reg = s2mpa01_volatile,
+   .cache_type = REGCACHE_FLAT,
+};
+
 static const struct regmap_config s2mps11_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -229,6 +261,9 @@ static int sec_pmic_probe(struct i2c_client *i2c,
}
 
switch (sec_pmic-device_type) {
+   case S2MPA01:
+   regmap = s2mpa01_regmap_config;
+   break;
case S2MPS11X:
regmap = s2mps11_regmap_config;
break;
@@ -283,6 +318,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
ret = mfd_add_devices(sec_pmic-dev, -1, s5m8767_devs,
  ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL);
break;
+   case S2MPA01:
+   ret = mfd_add_devices(sec_pmic-dev, -1, s2mpa01_devs,
+ ARRAY_SIZE(s2mpa01_devs), NULL, 0, NULL);
+   break;
case S2MPS11X:
ret = mfd_add_devices(sec_pmic-dev, -1, s2mps11_devs,
  ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL);
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 55510444b9fd..ab8c9d2f944e 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -18,6 +18,7 @@ enum sec_device_type {
S5M8751X,
S5M8763X,
S5M8767X,
+   S2MPA01,
S2MPS11X,
 };
 
@@ -92,7 +93,7 @@ struct sec_platform_data {
int buck3_default_idx;
int buck4_default_idx;
 
-   int buck_ramp_delay;
+   int buck_ramp_delay;
 
int buck2_ramp_delay;
int buck34_ramp_delay;
@@ -100,10 +101,15 @@ struct sec_platform_data {
int buck16_ramp_delay;
int buck7810_ramp_delay;
int buck9_ramp_delay;
-
-   boolbuck2_ramp_enable;
-   boolbuck3_ramp_enable;
-   boolbuck4_ramp_enable;
+   int buck24_ramp_delay;
+   int buck3_ramp_delay;
+   int buck7_ramp_delay;
+   int buck8910_ramp_delay;
+
+   boolbuck1_ramp_enable;
+   boolbuck2_ramp_enable

Re: [PATCH] mfd: sec-core: Fix I2C dummy device resource leak on probe failure

2014-03-18 Thread Sachin Kamat
On 18 March 2014 18:27, Krzysztof Kozlowski k.kozlow...@samsung.com wrote:
 Dummy I2C device allocated in sec_pmic_probe() leaked if
 devm_regmap_init_i2c() failed. Unregister it before returning from
 probe.

 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com

Looks good.
Reviewed-by: Sachin Kamat sachin.ka...@linaro.org

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/4] regulator: max8660: Silence checkpatch warnings

2014-03-19 Thread Sachin Kamat
On 18 March 2014 18:09, Mark Brown broo...@kernel.org wrote:
 On Tue, Mar 18, 2014 at 03:53:02PM +0530, Sachin Kamat wrote:
 Silences the following type of error/warnings:
 ERROR: that open brace { should be on the previous line
 WARNING: Missing a blank line after declarations

 Applied, but...

 - static const u8 max8660_addresses[MAX8660_N_REGS] =
 -   { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
 + static const u8 max8660_addresses[MAX8660_N_REGS] = {
 +   0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };

 Think about what you're doing here - you want the }; on a new line too.

Sorry about it. I was kind of in two minds about shifting it. I will
send a followup
for completeness.


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01

2014-03-19 Thread Sachin Kamat
On 18 March 2014 18:41, Krzysztof Kozlowski k.kozlow...@samsung.com wrote:
 Initialize the 'regmap_rtc' on S2MPA01 to some sane value. Sane at least
 for S5M87X chipsets, not S2MPS/S2MPA but it won't be used because
 rtc-s5m driver does not support S2MPA01.

 This fixes following error:
 drivers/mfd/sec-core.c:342:45: warning: 'regmap_rtc' may be used 
 uninitialized in this function [-Wuninitialized]

 Signed-off-by: Krzysztof Kozlowski k.kozlow...@samsung.com

From the point of suppressing this warning and considering how it is
done for S2MPS11,
Acked-by: Sachin Kamat sachin.ka...@linaro.org

However, shouldn't we be making this RTC handling conditional/optional
depending upon
whether the h/w or s/w supports/implements it?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v11 10/27] iommu/exynos: use managed device helper functions

2014-03-19 Thread Sachin Kamat
On 19 March 2014 14:29, Cho KyongHo pullip@samsung.com wrote:
 On Tue, 18 Mar 2014 16:14:53 +0100, Tomasz Figa wrote:
 On 18.03.2014 12:09, Cho KyongHo wrote:
  On Fri, 14 Mar 2014 20:52:43 +0530, Sachin Kamat wrote:
  Hi KyongHo,
 
  On 14 March 2014 10:35, Cho KyongHo pullip@samsung.com wrote:
  This patch uses managed device helper functions in the probe().
 
  Signed-off-by: Cho KyongHo pullip@samsung.com
  ---
  [snip]
 
  +   data-clk = devm_clk_get(dev, sysmmu);
  +   if (IS_ERR(data-clk)) {
  +   dev_info(dev, No gate clock found!\n);
  +   data-clk = NULL;
  +   }
 
  Why aren't you returning from here upon error?
 
  It is for the case of a System MMU which does not need clock gating.
 

 Are there really such cases?


 Yes.
 Especially in the case of initial stage of new SoC development.

 I have experianced some software workaround for H/W restriction
 needs prevention of clock gating for some devices.

So aren't these basically some exceptions/hacks rather than the usual way
of functioning of the device?

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] regulator: max8660: Fix brace alignment

2014-03-19 Thread Sachin Kamat
Move the }; to next line as is the general coding practice.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/max8660.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c
index aabfb3b2407c..2fc411188794 100644
--- a/drivers/regulator/max8660.c
+++ b/drivers/regulator/max8660.c
@@ -86,7 +86,8 @@ struct max8660 {
 static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val)
 {
static const u8 max8660_addresses[MAX8660_N_REGS] = {
- 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
+0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80
+   };
 
int ret;
u8 reg_val = (max8660-shadow_regs[reg]  mask) | val;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drm/exynos: fix error return code in exynos_drm_ipp_set_property()

2013-05-07 Thread Sachin Kamat
Hi Wei Yongjun,

On 7 May 2013 18:54, Wei Yongjun weiyj...@gmail.com wrote:
 From: Wei Yongjun yongjun_...@trendmicro.com.cn

 Fix to return a negative error code from the error handling
 case instead of 0, as done elsewhere in this function.
 ipp_create_cmd_work() return ERR_PTR() on error and never return
 NULL, so use IS_ERR() instead of IS_ERR_OR_NULL().

 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
 ---

I have submitted a patch [1] to use IS_ERR instead of IS_ERR_OR_NULL()
for all incorrect instances in this driver.
Please base your patch fixing the return code on top of my patch.

[1] http://lists.freedesktop.org/archives/dri-devel/2013-April/038059.html

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] regulator: isl6271a: Use NULL instead of 0

2013-05-08 Thread Sachin Kamat
init_data is a pointer. Use NULL instead of 0.

Silences the following sparse warning:
drivers/regulator/isl6271a-regulator.c:133:44:
warning: Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Marek Vasut marek.va...@gmail.com
---
 drivers/regulator/isl6271a-regulator.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/isl6271a-regulator.c 
b/drivers/regulator/isl6271a-regulator.c
index d1e5bee..b99c49b 100644
--- a/drivers/regulator/isl6271a-regulator.c
+++ b/drivers/regulator/isl6271a-regulator.c
@@ -130,7 +130,7 @@ static int isl6271a_probe(struct i2c_client *i2c,
if (i == 0)
config.init_data = init_data;
else
-   config.init_data = 0;
+   config.init_data = NULL;
config.driver_data = pmic;
 
pmic-rdev[i] = regulator_register(isl_rd[i], config);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] regulator: palmas: Fix incorrect condition

2013-05-08 Thread Sachin Kamat
Since 'id' cannot take two values at the same time, the condition
should probably be an OR (||) instead of AND ().

Introduced by commit 28d1e8cd67 (regulator: palma: add ramp delay
support through regulator constraints).

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laxman Dewangan ldewan...@nvidia.com
---
Compile tested against for-next branch of regulator tree.
---
 drivers/regulator/palmas-regulator.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/palmas-regulator.c 
b/drivers/regulator/palmas-regulator.c
index 92ceed0..ced7416 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -840,7 +840,7 @@ static int palmas_regulators_probe(struct platform_device 
*pdev)
break;
}
 
-   if ((id == PALMAS_REG_SMPS6)  (id == PALMAS_REG_SMPS8))
+   if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8))
ramp_delay_support = true;
 
if (ramp_delay_support) {
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] regulator: dbx500: Make local symbol static

2013-05-08 Thread Sachin Kamat
power_state_active_get is used only in this file. Make it static.
While at it also move this function definition inside the
CONFIG_REGULATOR_DEBUG macro as it is called only from within it.
This also avoids further build warning related to unused definition.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/regulator/dbx500-prcmu.c |   24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/regulator/dbx500-prcmu.c b/drivers/regulator/dbx500-prcmu.c
index 89bd2fa..ce89f78 100644
--- a/drivers/regulator/dbx500-prcmu.c
+++ b/drivers/regulator/dbx500-prcmu.c
@@ -24,18 +24,6 @@
 static int power_state_active_cnt; /* will initialize to zero */
 static DEFINE_SPINLOCK(power_state_active_lock);
 
-int power_state_active_get(void)
-{
-   unsigned long flags;
-   int cnt;
-
-   spin_lock_irqsave(power_state_active_lock, flags);
-   cnt = power_state_active_cnt;
-   spin_unlock_irqrestore(power_state_active_lock, flags);
-
-   return cnt;
-}
-
 void power_state_active_enable(void)
 {
unsigned long flags;
@@ -65,6 +53,18 @@ out:
 
 #ifdef CONFIG_REGULATOR_DEBUG
 
+static int power_state_active_get(void)
+{
+   unsigned long flags;
+   int cnt;
+
+   spin_lock_irqsave(power_state_active_lock, flags);
+   cnt = power_state_active_cnt;
+   spin_unlock_irqrestore(power_state_active_lock, flags);
+
+   return cnt;
+}
+
 static struct ux500_regulator_debug {
struct dentry *dir;
struct dentry *status_file;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 11/15] regulator: ti-abb: Convert to use devm_ioremap_resource

2013-06-10 Thread Sachin Kamat
On 10 June 2013 17:05, Tushar Behera tushar.beh...@linaro.org wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and deprecated the use of
 devm_request_and_ioremap().

 Signed-off-by: Tushar Behera tushar.beh...@linaro.org
 CC: Mark Brown broo...@kernel.org
 CC: Liam Girdwood lgirdw...@gmail.com
 ---
  drivers/regulator/ti-abb-regulator.c |   12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)

 diff --git a/drivers/regulator/ti-abb-regulator.c 
 b/drivers/regulator/ti-abb-regulator.c
 index 870d209..f494a11 100644
 --- a/drivers/regulator/ti-abb-regulator.c
 +++ b/drivers/regulator/ti-abb-regulator.c
 @@ -722,10 +722,10 @@ static int ti_abb_probe(struct platform_device *pdev)
 ret = -ENODEV;
 goto err;
 }
 -   abb-base = devm_request_and_ioremap(dev, res);
 -   if (!abb-base) {
 +   abb-base = devm_ioremap_resource(dev, res);
 +   if (IS_ERR(abb-base)) {
 dev_err(dev, Unable to map '%s'\n, pname);

You may remove the above error message as devm_ioremap_resource prints
its own error messages.

 -   ret = -ENOMEM;
 +   ret = PTR_ERR(abb-base);
 goto err;
 }

 @@ -776,10 +776,10 @@ static int ti_abb_probe(struct platform_device *pdev)
 ret = -ENODEV;
 goto skip_opt;
 }
 -   abb-ldo_base = devm_request_and_ioremap(dev, res);
 -   if (!abb-ldo_base) {
 +   abb-ldo_base = devm_ioremap_resource(dev, res);
 +   if (IS_ERR(abb-ldo_base)) {
 dev_err(dev, Unable to map '%s'\n, pname);

ditto

 -   ret = -ENOMEM;
 +   ret = PTR_ERR(abb-ldo_base);
 goto err;
 }

 --
 1.7.9.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 01/15] sparc,leon: Convert to use devm_ioremap_resource

2013-06-10 Thread Sachin Kamat
On 10 June 2013 17:04, Tushar Behera tushar.beh...@linaro.org wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and deprecated the use of
 devm_request_and_ioremap().

 Signed-off-by: Tushar Behera tushar.beh...@linaro.org
 CC: sparcli...@vger.kernel.org
 CC: David S. Miller da...@davemloft.net
 ---
 * Not compile tested.
  arch/sparc/kernel/leon_pci_grpci1.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

 diff --git a/arch/sparc/kernel/leon_pci_grpci1.c 
 b/arch/sparc/kernel/leon_pci_grpci1.c
 index 7739a54..23497f4 100644
 --- a/arch/sparc/kernel/leon_pci_grpci1.c
 +++ b/arch/sparc/kernel/leon_pci_grpci1.c
 @@ -536,10 +536,10 @@ static int grpci1_of_probe(struct platform_device 
 *ofdev)

 /* find device register base address */
 res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
 -   regs = devm_request_and_ioremap(ofdev-dev, res);
 -   if (!regs) {
 +   regs = devm_ioremap_resource(ofdev-dev, res);
 +   if (IS_ERR(regs)) {
 dev_err(ofdev-dev, io-regs mapping failed\n);

You may remove the above error message as devm_ioremap_resource prints
its own error messages.

 -   return -EADDRNOTAVAIL;
 +   return PTR_ERR(regs);
 }

 /*
 --
 1.7.9.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 12/15] ASoC: spear: Convert to use devm_ioremap_resource

2013-06-10 Thread Sachin Kamat
On 10 June 2013 17:05, Tushar Behera tushar.beh...@linaro.org wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and deprecated the use of
 devm_request_and_ioremap().

This patch does a little more than just conversion. May that change
could be mentioned here.


 Signed-off-by: Tushar Behera tushar.beh...@linaro.org
 CC: alsa-de...@alsa-project.org
 CC: Liam Girdwood lgirdw...@gmail.com
 CC: Mark Brown broo...@kernel.org
 ---
  sound/soc/spear/spdif_out.c |   20 +---
  1 file changed, 5 insertions(+), 15 deletions(-)

 diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
 index 4bde512..896ee7f 100644
 --- a/sound/soc/spear/spdif_out.c
 +++ b/sound/soc/spear/spdif_out.c
 @@ -282,27 +282,17 @@ static int spdif_out_probe(struct platform_device *pdev)
 struct resource *res;
 int ret;

 -   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 -   if (!res)
 -   return -EINVAL;
 -
 -   if (!devm_request_mem_region(pdev-dev, res-start,
 -   resource_size(res), pdev-name)) {
 -   dev_warn(pdev-dev, Failed to get memory resourse\n);
 -   return -ENOENT;
 -   }
 -
 host = devm_kzalloc(pdev-dev, sizeof(*host), GFP_KERNEL);
 if (!host) {
 dev_warn(pdev-dev, kzalloc fail\n);
 return -ENOMEM;
 }

 -   host-io_base = devm_request_and_ioremap(pdev-dev, res-start,
 -   resource_size(res));
 -   if (!host-io_base) {
 -   dev_warn(pdev-dev, ioremap failed\n);
 -   return -ENOMEM;
 +   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +   host-io_base = devm_ioremap_resource(pdev-dev, res);
 +   if (IS_ERR(host-io_base)) {
 +   dev_warn(pdev-dev, devm_ioremap_resource failed\n);

This print is not needed as devm_ioremap_resource prints its own messages.


 +   return PTR_ERR(host-io_base);
 }

 host-clk = devm_clk_get(pdev-dev, NULL);
 --
 1.7.9.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 13/15] pci: mvebu: Convert to use devm_ioremap_resource

2013-06-10 Thread Sachin Kamat
On 10 June 2013 17:05, Tushar Behera tushar.beh...@linaro.org wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and deprecated the use of
 devm_request_and_ioremap().

 Signed-off-by: Tushar Behera tushar.beh...@linaro.org
 CC: linux-...@vger.kernel.org
 CC: Bjorn Helgaas bhelg...@google.com
 ---
  drivers/pci/host/pci-mvebu.c |5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

 diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
 index 13a633b..e714876 100644
 --- a/drivers/pci/host/pci-mvebu.c
 +++ b/drivers/pci/host/pci-mvebu.c
 @@ -752,7 +752,7 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
 if (ret)
 return NULL;

 -   return devm_request_and_ioremap(pdev-dev, regs);
 +   return devm_ioremap_resource(pdev-dev, regs);
  }

  static int __init mvebu_pcie_probe(struct platform_device *pdev)
 @@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct 
 platform_device *pdev)
 continue;

 port-base = mvebu_pcie_map_registers(pdev, child, port);
 -   if (!port-base) {
 +   if (IS_ERR(port-base)) {
 dev_err(pdev-dev, PCIe%d.%d: cannot map 
 registers\n,
 port-port, port-lane);

This error message is redundant.

 +   port-base = NULL;
Probably this is also not needed.

 continue;
 }

 --
 1.7.9.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/



-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/1] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-12 Thread Sachin Kamat
devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Miguel Aguilar miguel.agui...@ridgerun.com
---
Patch is based on mfd-next tree and compile tested.
This driver gives following compilation error (not introduced by this patch):
drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration
of function ‘io_v2p’ [-Werror=implicit-function-declaration]
   (dma_addr_t)(io_v2p(davinci_vc-base) + DAVINCI_VC_WFIFO);

In order to test my changes I added the following to davinci_voicecodec.h file:
+#define IO_OFFSET  0xfd00 /* Virtual IO = 0xfec0 */
+#define io_v2p(va) ((va) - IO_OFFSET)

I am not sure if these changes are right fix for the above error.
---

 drivers/mfd/davinci_voicecodec.c   |   48 +++-
 include/linux/mfd/davinci_voicecodec.h |2 --
 2 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index b6e2973..fb64398 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -46,7 +46,7 @@ void davinci_vc_write(struct davinci_vc *davinci_vc,
 static int __init davinci_vc_probe(struct platform_device *pdev)
 {
struct davinci_vc *davinci_vc;
-   struct resource *res, *mem;
+   struct resource *res;
struct mfd_cell *cell = NULL;
int ret;
 
@@ -58,7 +58,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
return -ENOMEM;
}
 
-   davinci_vc-clk = clk_get(pdev-dev, NULL);
+   davinci_vc-clk = devm_clk_get(pdev-dev, NULL);
if (IS_ERR(davinci_vc-clk)) {
dev_dbg(pdev-dev,
could not get the clock for voice codec\n);
@@ -67,35 +67,18 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
clk_enable(davinci_vc-clk);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, no mem resource\n);
-   ret = -ENODEV;
-   goto fail2;
-   }
-
-   davinci_vc-pbase = res-start;
-   davinci_vc-base_size = resource_size(res);
 
-   mem = request_mem_region(davinci_vc-pbase, davinci_vc-base_size,
-pdev-name);
-   if (!mem) {
-   dev_err(pdev-dev, VCIF region already claimed\n);
-   ret = -EBUSY;
-   goto fail2;
-   }
-
-   davinci_vc-base = ioremap(davinci_vc-pbase, davinci_vc-base_size);
-   if (!davinci_vc-base) {
-   dev_err(pdev-dev, can't ioremap mem resource.\n);
-   ret = -ENOMEM;
-   goto fail3;
+   davinci_vc-base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(davinci_vc-base)) {
+   ret = PTR_ERR(davinci_vc-base);
+   goto fail;
}
 
res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_tx_channel = res-start;
@@ -106,7 +89,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_rx_channel = res-start;
@@ -132,19 +115,13 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
  DAVINCI_VC_CELLS, NULL, 0, NULL);
if (ret != 0) {
dev_err(pdev-dev, fail to register client devices\n);
-   goto fail4;
+   goto fail;
}
 
return 0;
 
-fail4:
-   iounmap(davinci_vc-base);
-fail3:
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-fail2:
+fail:
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return ret;
 }
@@ -155,12 +132,7 @@ static int davinci_vc_remove(struct platform_device *pdev)
 
mfd_remove_devices(pdev-dev);
 
-   iounmap(davinci_vc-base);
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return 0;
 }
diff --git a/include/linux/mfd/davinci_voicecodec.h 
b/include/linux/mfd/davinci_voicecodec.h
index 0ab6132..94c53d4 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -112,8 +112,6 @@ struct davinci_vc {
 
/* Memory resources */
void __iomem *base;
-   resource_size_t pbase;
-   size_t base_size;
 
/* MFD cells */
struct mfd_cell cells[DAVINCI_VC_CELLS];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel

[PATCH Resend 1/1] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-12 Thread Sachin Kamat
devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Miguel Aguilar miguel.agui...@ridgerun.com
---
CC'd Lee Jones
 
Patch is based on mfd-next tree and compile tested.
This driver gives following compilation error (not introduced by this patch):
drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration
of function ‘io_v2p’ [-Werror=implicit-function-declaration]
   (dma_addr_t)(io_v2p(davinci_vc-base) + DAVINCI_VC_WFIFO);

In order to test my changes I added the following to davinci_voicecodec.h file:
+#define IO_OFFSET  0xfd00 /* Virtual IO = 0xfec0 */
+#define io_v2p(va) ((va) - IO_OFFSET)

I am not sure if these changes are right fix for the above error.
---

 drivers/mfd/davinci_voicecodec.c   |   48 +++-
 include/linux/mfd/davinci_voicecodec.h |2 --
 2 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index b6e2973..fb64398 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -46,7 +46,7 @@ void davinci_vc_write(struct davinci_vc *davinci_vc,
 static int __init davinci_vc_probe(struct platform_device *pdev)
 {
struct davinci_vc *davinci_vc;
-   struct resource *res, *mem;
+   struct resource *res;
struct mfd_cell *cell = NULL;
int ret;
 
@@ -58,7 +58,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
return -ENOMEM;
}
 
-   davinci_vc-clk = clk_get(pdev-dev, NULL);
+   davinci_vc-clk = devm_clk_get(pdev-dev, NULL);
if (IS_ERR(davinci_vc-clk)) {
dev_dbg(pdev-dev,
could not get the clock for voice codec\n);
@@ -67,35 +67,18 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
clk_enable(davinci_vc-clk);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, no mem resource\n);
-   ret = -ENODEV;
-   goto fail2;
-   }
-
-   davinci_vc-pbase = res-start;
-   davinci_vc-base_size = resource_size(res);
 
-   mem = request_mem_region(davinci_vc-pbase, davinci_vc-base_size,
-pdev-name);
-   if (!mem) {
-   dev_err(pdev-dev, VCIF region already claimed\n);
-   ret = -EBUSY;
-   goto fail2;
-   }
-
-   davinci_vc-base = ioremap(davinci_vc-pbase, davinci_vc-base_size);
-   if (!davinci_vc-base) {
-   dev_err(pdev-dev, can't ioremap mem resource.\n);
-   ret = -ENOMEM;
-   goto fail3;
+   davinci_vc-base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(davinci_vc-base)) {
+   ret = PTR_ERR(davinci_vc-base);
+   goto fail;
}
 
res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_tx_channel = res-start;
@@ -106,7 +89,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_rx_channel = res-start;
@@ -132,19 +115,13 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
  DAVINCI_VC_CELLS, NULL, 0, NULL);
if (ret != 0) {
dev_err(pdev-dev, fail to register client devices\n);
-   goto fail4;
+   goto fail;
}
 
return 0;
 
-fail4:
-   iounmap(davinci_vc-base);
-fail3:
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-fail2:
+fail:
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return ret;
 }
@@ -155,12 +132,7 @@ static int davinci_vc_remove(struct platform_device *pdev)
 
mfd_remove_devices(pdev-dev);
 
-   iounmap(davinci_vc-base);
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return 0;
 }
diff --git a/include/linux/mfd/davinci_voicecodec.h 
b/include/linux/mfd/davinci_voicecodec.h
index 0ab6132..94c53d4 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -112,8 +112,6 @@ struct davinci_vc {
 
/* Memory resources */
void __iomem *base;
-   resource_size_t pbase;
-   size_t base_size;
 
/* MFD cells */
struct mfd_cell cells[DAVINCI_VC_CELLS];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe

[PATCH 1/1] mfd: 88pm860x: Use devm_regmap_init_i2c()

2013-06-12 Thread Sachin Kamat
devm_regmap_init_i2c() is device managed and makes cleanup simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/mfd/88pm860x-core.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index ef6d82c..eeb481d 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1156,7 +1156,7 @@ static int pm860x_probe(struct i2c_client *client,
return -ENOMEM;
 
chip-id = verify_addr(client);
-   chip-regmap = regmap_init_i2c(client, pm860x_regmap_config);
+   chip-regmap = devm_regmap_init_i2c(client, pm860x_regmap_config);
if (IS_ERR(chip-regmap)) {
ret = PTR_ERR(chip-regmap);
dev_err(client-dev, Failed to allocate register map: %d\n,
@@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client)
regmap_exit(chip-regmap_companion);
i2c_unregister_device(chip-companion);
}
-   regmap_exit(chip-regmap);
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pwm: Fill in missing .owner fields

2013-06-12 Thread Sachin Kamat
Hi Thierry,

On 12 June 2013 16:59, Thierry Reding thierry.red...@gmail.com wrote:
 Some drivers don't set the .owner fields of the struct device_driver or
 struct pwm_ops, which causes the module usage count to become wrong.


Recently a patch [1] was added to solve this issue of missing .owner
fileds in struct platform_driver.
Probably something similar could be done for struct pwm_ops too?


[1] https://patchwork.kernel.org/patch/2612961/

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC: PATCH] err.h: silence warning when using IS_ERR on void __iomem *

2013-06-12 Thread Sachin Kamat
On 13 June 2013 03:01, Marc Kleine-Budde m...@pengutronix.de wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and encourage to check its return value 
 with
 IS_ERR(). This however leads to the following sparse warnings, as
 devm_ioremap_resource() returns a void __iomem pointer:

 drivers/net/can/c_can/c_can_platform.c:205:32: warning: incorrect type in 
 argument 1 (different address spaces)
 drivers/net/can/c_can/c_can_platform.c:205:32:expected void const *ptr
 drivers/net/can/c_can/c_can_platform.c:205:32:got unsigned int [noderef] 
 [usertype] asn:2*raminit_ctrlreg

CC ing Thierry who has solved this issue some time back.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 09/15] net: can: Convert to use devm_ioremap_resource

2013-06-12 Thread Sachin Kamat
On 13 June 2013 11:00, Tushar Behera tushar.beh...@linaro.org wrote:
 On 06/10/2013 05:05 PM, Tushar Behera wrote:
 Commit 75096579c3ac (lib: devres: Introduce devm_ioremap_resource())
 introduced devm_ioremap_resource() and deprecated the use of
 devm_request_and_ioremap().

 Signed-off-by: Tushar Behera tushar.beh...@linaro.org
 CC: net...@vger.kernel.org
 CC: linux-...@vger.kernel.org
 CC: Marc Kleine-Budde m...@pengutronix.de
 CC: Wolfgang Grandegger w...@grandegger.com
 ---
  drivers/net/can/c_can/c_can_platform.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/net/can/c_can/c_can_platform.c 
 b/drivers/net/can/c_can/c_can_platform.c
 index 6b6130b..b918c73 100644
 --- a/drivers/net/can/c_can/c_can_platform.c
 +++ b/drivers/net/can/c_can/c_can_platform.c
 @@ -201,8 +201,8 @@ static int c_can_plat_probe(struct platform_device *pdev)
   priv-instance = pdev-id;

   res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 - priv-raminit_ctrlreg = devm_request_and_ioremap(pdev-dev, 
 res);
 - if (!priv-raminit_ctrlreg || priv-instance  0)
 + priv-raminit_ctrlreg = devm_ioremap_resource(pdev-dev, res);
 + if (IS_ERR(priv-raminit_ctrlreg) || priv-instance  0)
   dev_info(pdev-dev, control memory is not used for 
 raminit\n);
   else
   priv-raminit = c_can_hw_raminit;


 IS_ERR() check on the return value of devm_ioremap_resource produces
 following sparse warning. This is because of the __iomem address space
 attribute. How should we fix this?

 drivers/net/can/c_can/c_can_platform.c:205:32: warning: incorrect type
 in argument 1 (different address spaces)
 drivers/net/can/c_can/c_can_platform.c:205:32:expected void const *ptr
 drivers/net/can/c_can/c_can_platform.c:205:32:got unsigned int
 [noderef] [usertype] asn:2*raminit_ctrlreg


This is a known issue since the time devm_ioremap_resource was
introduced. Thierry had already submitted some fixes for this.
I am not sure if they have been applied yet.
More details here:
https://patchwork.kernel.org/patch/2071361/

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH Resend 1/1] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-13 Thread Sachin Kamat
Hi Lee,

On 13 June 2013 16:19, Lee Jones lee.jo...@linaro.org wrote:
 On Wed, 12 Jun 2013, Sachin Kamat wrote:

 devm_* APIs are device managed and make code simpler.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Miguel Aguilar miguel.agui...@ridgerun.com
 ---
 CC'd Lee Jones

 Can you resubmit this based on -rc5 please?

 There have been some related changes since you wrote this patch.

This patch is based on Samuel's mfd-next tree [1].
This patch is dependent on your patch mfd: davinci_voicecodec:
Convert to managed resources for allocating memory
which is applied in mfd-next.

Please let me know which other tree you want me to rebase this patch
on considering the dependency.

[1] http://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next.git
-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH Resend 1/1] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-14 Thread Sachin Kamat
On 14 June 2013 12:36, Lee Jones lee.jo...@linaro.org wrote:
 On Fri, 14 Jun 2013, Sachin Kamat wrote:

 Hi Lee,

 On 13 June 2013 16:19, Lee Jones lee.jo...@linaro.org wrote:
  On Wed, 12 Jun 2013, Sachin Kamat wrote:
 
  devm_* APIs are device managed and make code simpler.
 
  Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
  Cc: Miguel Aguilar miguel.agui...@ridgerun.com
  ---
  CC'd Lee Jones
 
  Can you resubmit this based on -rc5 please?
 
  There have been some related changes since you wrote this patch.

 This patch is based on Samuel's mfd-next tree [1].
 This patch is dependent on your patch mfd: davinci_voicecodec:
 Convert to managed resources for allocating memory
 which is applied in mfd-next.

 Please let me know which other tree you want me to rebase this patch
 on considering the dependency.

 [1] http://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-next.git

 I believe Sam's branch has been updated considerably since you wrote
 the patch. Would you mind rebasing it onto Sam's latest master branch
 please? Should be commit: d8c5d658f425bd25bbfb137f2617f59ed4fdee7d.

It applies cleanly on top of the commit:
d8c5d658f425bd25bbfb137f2617f59ed4fdee7d
(Merge tag 'am335x_tsc-adc' of git://breakpoint.cc/bigeasy/linux).

I am surprised that you are getting errors. Anyway resending once again.

-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH Resend] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-14 Thread Sachin Kamat
devm_* APIs are device managed and make code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Miguel Aguilar miguel.agui...@ridgerun.com
---
Patch is based on mfd-next tree and compile tested.
This driver gives following compilation error (not introduced by this patch):
drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration
of function ‘io_v2p’ [-Werror=implicit-function-declaration]
   (dma_addr_t)(io_v2p(davinci_vc-base) + DAVINCI_VC_WFIFO);

In order to test my changes I added the following to davinci_voicecodec.h file:
+#define IO_OFFSET  0xfd00 /* Virtual IO = 0xfec0 */
+#define io_v2p(va) ((va) - IO_OFFSET)

I am not sure if these changes are right fix for the above error.
---

 drivers/mfd/davinci_voicecodec.c   |   48 +++-
 include/linux/mfd/davinci_voicecodec.h |2 --
 2 files changed, 10 insertions(+), 40 deletions(-)

diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c
index b6e2973..fb64398 100644
--- a/drivers/mfd/davinci_voicecodec.c
+++ b/drivers/mfd/davinci_voicecodec.c
@@ -46,7 +46,7 @@ void davinci_vc_write(struct davinci_vc *davinci_vc,
 static int __init davinci_vc_probe(struct platform_device *pdev)
 {
struct davinci_vc *davinci_vc;
-   struct resource *res, *mem;
+   struct resource *res;
struct mfd_cell *cell = NULL;
int ret;
 
@@ -58,7 +58,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
return -ENOMEM;
}
 
-   davinci_vc-clk = clk_get(pdev-dev, NULL);
+   davinci_vc-clk = devm_clk_get(pdev-dev, NULL);
if (IS_ERR(davinci_vc-clk)) {
dev_dbg(pdev-dev,
could not get the clock for voice codec\n);
@@ -67,35 +67,18 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
clk_enable(davinci_vc-clk);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(pdev-dev, no mem resource\n);
-   ret = -ENODEV;
-   goto fail2;
-   }
-
-   davinci_vc-pbase = res-start;
-   davinci_vc-base_size = resource_size(res);
 
-   mem = request_mem_region(davinci_vc-pbase, davinci_vc-base_size,
-pdev-name);
-   if (!mem) {
-   dev_err(pdev-dev, VCIF region already claimed\n);
-   ret = -EBUSY;
-   goto fail2;
-   }
-
-   davinci_vc-base = ioremap(davinci_vc-pbase, davinci_vc-base_size);
-   if (!davinci_vc-base) {
-   dev_err(pdev-dev, can't ioremap mem resource.\n);
-   ret = -ENOMEM;
-   goto fail3;
+   davinci_vc-base = devm_ioremap_resource(pdev-dev, res);
+   if (IS_ERR(davinci_vc-base)) {
+   ret = PTR_ERR(davinci_vc-base);
+   goto fail;
}
 
res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_tx_channel = res-start;
@@ -106,7 +89,7 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
if (!res) {
dev_err(pdev-dev, no DMA resource\n);
ret = -ENXIO;
-   goto fail4;
+   goto fail;
}
 
davinci_vc-davinci_vcif.dma_rx_channel = res-start;
@@ -132,19 +115,13 @@ static int __init davinci_vc_probe(struct platform_device 
*pdev)
  DAVINCI_VC_CELLS, NULL, 0, NULL);
if (ret != 0) {
dev_err(pdev-dev, fail to register client devices\n);
-   goto fail4;
+   goto fail;
}
 
return 0;
 
-fail4:
-   iounmap(davinci_vc-base);
-fail3:
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-fail2:
+fail:
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return ret;
 }
@@ -155,12 +132,7 @@ static int davinci_vc_remove(struct platform_device *pdev)
 
mfd_remove_devices(pdev-dev);
 
-   iounmap(davinci_vc-base);
-   release_mem_region(davinci_vc-pbase, davinci_vc-base_size);
-
clk_disable(davinci_vc-clk);
-   clk_put(davinci_vc-clk);
-   davinci_vc-clk = NULL;
 
return 0;
 }
diff --git a/include/linux/mfd/davinci_voicecodec.h 
b/include/linux/mfd/davinci_voicecodec.h
index 0ab6132..94c53d4 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -112,8 +112,6 @@ struct davinci_vc {
 
/* Memory resources */
void __iomem *base;
-   resource_size_t pbase;
-   size_t base_size;
 
/* MFD cells */
struct mfd_cell cells[DAVINCI_VC_CELLS];
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel

[PATCH 1/1] pinctrl: exynos: Fix build breakage

2013-06-17 Thread Sachin Kamat
'exynos_wkup_irq_mask' should be defined ahead of its call.

Fixes the following error:
drivers/pinctrl/pinctrl-exynos.c: In function ‘exynos_wkup_irq_mask’:
drivers/pinctrl/pinctrl-exynos.c:299:3: error: implicit declaration of
function ‘exynos_wkup_irq_ack’ [-Werror=implicit-function-declaration]
   exynos_wkup_irq_ack(irqd);

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Doug Anderson diand...@chromium.org
---
 drivers/pinctrl/pinctrl-exynos.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
index 8cd5bf5..f9277bc 100644
--- a/drivers/pinctrl/pinctrl-exynos.c
+++ b/drivers/pinctrl/pinctrl-exynos.c
@@ -279,6 +279,15 @@ err_domains:
return ret;
 }
 
+static void exynos_wkup_irq_ack(struct irq_data *irqd)
+{
+   struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
+   struct samsung_pinctrl_drv_data *d = b-drvdata;
+   unsigned long pend = d-ctrl-weint_pend + b-eint_offset;
+
+   writel(1  irqd-hwirq, d-virt_base + pend);
+}
+
 static void exynos_wkup_irq_mask(struct irq_data *irqd)
 {
struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
@@ -307,15 +316,6 @@ static void exynos_wkup_irq_mask(struct irq_data *irqd)
spin_unlock_irqrestore(b-slock, flags);
 }
 
-static void exynos_wkup_irq_ack(struct irq_data *irqd)
-{
-   struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
-   struct samsung_pinctrl_drv_data *d = b-drvdata;
-   unsigned long pend = d-ctrl-weint_pend + b-eint_offset;
-
-   writel(1  irqd-hwirq, d-virt_base + pend);
-}
-
 static void exynos_wkup_irq_unmask(struct irq_data *irqd)
 {
struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH Resend] pinctrl: exynos: Fix build breakage

2013-06-17 Thread Sachin Kamat
'exynos_wkup_irq_ack' should be defined ahead of its call.

Fixes the following error:
drivers/pinctrl/pinctrl-exynos.c: In function ‘exynos_wkup_irq_mask’:
drivers/pinctrl/pinctrl-exynos.c:299:3: error: implicit declaration of
function ‘exynos_wkup_irq_ack’ [-Werror=implicit-function-declaration]
   exynos_wkup_irq_ack(irqd);

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Doug Anderson diand...@chromium.org
---
Fixed the commit message.
---

 drivers/pinctrl/pinctrl-exynos.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
index 8cd5bf5..f9277bc 100644
--- a/drivers/pinctrl/pinctrl-exynos.c
+++ b/drivers/pinctrl/pinctrl-exynos.c
@@ -279,6 +279,15 @@ err_domains:
return ret;
 }
 
+static void exynos_wkup_irq_ack(struct irq_data *irqd)
+{
+   struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
+   struct samsung_pinctrl_drv_data *d = b-drvdata;
+   unsigned long pend = d-ctrl-weint_pend + b-eint_offset;
+
+   writel(1  irqd-hwirq, d-virt_base + pend);
+}
+
 static void exynos_wkup_irq_mask(struct irq_data *irqd)
 {
struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
@@ -307,15 +316,6 @@ static void exynos_wkup_irq_mask(struct irq_data *irqd)
spin_unlock_irqrestore(b-slock, flags);
 }
 
-static void exynos_wkup_irq_ack(struct irq_data *irqd)
-{
-   struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
-   struct samsung_pinctrl_drv_data *d = b-drvdata;
-   unsigned long pend = d-ctrl-weint_pend + b-eint_offset;
-
-   writel(1  irqd-hwirq, d-virt_base + pend);
-}
-
 static void exynos_wkup_irq_unmask(struct irq_data *irqd)
 {
struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH Resend] pinctrl: exynos: Fix build breakage

2013-06-17 Thread Sachin Kamat
On 17 June 2013 16:55, Linus Walleij linus.wall...@linaro.org wrote:
 On Mon, Jun 17, 2013 at 11:38 AM, Sachin Kamat sachin.ka...@linaro.org 
 wrote:

 'exynos_wkup_irq_ack' should be defined ahead of its call.

 Fixes the following error:
 drivers/pinctrl/pinctrl-exynos.c: In function ‘exynos_wkup_irq_mask’:
 drivers/pinctrl/pinctrl-exynos.c:299:3: error: implicit declaration of
 function ‘exynos_wkup_irq_ack’ [-Werror=implicit-function-declaration]
exynos_wkup_irq_ack(irqd);

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Doug Anderson diand...@chromium.org
 ---
 Fixed the commit message.
 ---

 Applied.

Thanks.


 Usually you should state which commit caused
 the problem in the commit message.

Usually I do. But in this case it was not caused by a single commit
per se but a combination.
Hence I wasn't sure if I should mention both as the ones causing it.


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Allow binding drivers/uio/uio_pdrv_genirq.c to devices using command line option

2013-06-17 Thread Sachin Kamat
Hi Greg,

On 17 June 2013 23:07, Greg KH gre...@linuxfoundation.org wrote:
 On Mon, Jun 17, 2013 at 03:47:41PM +0200, Pavel Machek wrote:
 Hi!

  This adds ability to bind uio driver to given open firmware device
  using command line option. Thus, userspace driver can be developed and
  used without modifying the kernel.
 
  Signed-off-by: Pavel Machek pa...@denx.de

 Ping? Greg, could you apply this patch? Or is there someone else I
 should ask to apply it?

 Ugh, Hans seems to have dropped off of the net for a long time now, so I
 guess I'll start queueing up UIO patches again.  Care to resend this?


Even I have a couple of outstanding UIO patches [1-2]. Shall I resend
them as well?

[1] https://lkml.org/lkml/2013/3/14/154
[2] https://patchwork.kernel.org/patch/2268921/


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH Resend 1/1] mfd: davinci_voicecodec: Convert to use devm_* APIs

2013-06-18 Thread Sachin Kamat
Hi Samuel,

On 18 June 2013 14:10, Samuel Ortiz sa...@linux.intel.com wrote:
 Hi Sachin,

 On Wed, Jun 12, 2013 at 01:49:42PM +0530, Sachin Kamat wrote:
 devm_* APIs are device managed and make code simpler.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Miguel Aguilar miguel.agui...@ridgerun.com
 ---
 CC'd Lee Jones

 Patch is based on mfd-next tree and compile tested.
 This driver gives following compilation error (not introduced by this patch):
 drivers/mfd/davinci_voicecodec.c:86:3: error: implicit declaration
 of function ‘io_v2p’ [-Werror=implicit-function-declaration]
(dma_addr_t)(io_v2p(davinci_vc-base) + DAVINCI_VC_WFIFO);

 In order to test my changes I added the following to davinci_voicecodec.h 
 file:
 +#define IO_OFFSET  0xfd00 /* Virtual IO = 0xfec0 */
 +#define io_v2p(va) ((va) - IO_OFFSET)

 I am not sure if these changes are right fix for the above error.
 io_v2p is define in davinci's mach/hardware.h so I believe this is what
 you should include in davinci_voicecodec.h.

Thanks. That was only required for compile testing my patch.
Does the patch look good?


-- 
With warm regards,
Sachin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] pinctrl: spear/plgpio: Staticize spear310_o2p

2013-06-18 Thread Sachin Kamat
'spear310_o2p' is referenced only in this file.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Viresh Kumar viresh.ku...@linaro.org
---
 drivers/pinctrl/spear/pinctrl-plgpio.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c 
b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 6b090be..0a7f0bdb 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -441,7 +441,7 @@ static int spear310_p2o(int pin)
return offset;
 }
 
-int spear310_o2p(int offset)
+static int spear310_o2p(int offset)
 {
if (offset = 3)
return 101 - offset;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    1   2   3   4   5   6   7   8   9   10   >