* [PATCH 01/12] mfd: Bunch of clean-ups and checkpatch fixes
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij
This patch-set contains a bunch of cleanups for issues that were
either noticed during recent patch submission review or that
checkpatch spotted.
drivers/mfd/88pm805.c | 2 +-
drivers/mfd/88pm860x-core.c | 37 +++++++++++++++++++------------
drivers/mfd/88pm860x-i2c.c | 3 ++-
drivers/mfd/aat2870-core.c | 5 ++++-
drivers/mfd/ab3100-core.c | 54 ++++++++++++++++++--------------------
drivers/mfd/ab8500-core.c | 49 ++++++++++++++++++-------------------
drivers/mfd/ab8500-debugfs.c | 14 ++++++------
drivers/mfd/arizona-core.c | 4 ++--
drivers/mfd/arizona-i2c.c | 5 +++--
drivers/mfd/arizona-spi.c | 3 ++-
drivers/mfd/arizona.h | 4 ++--
drivers/mfd/intel_soc_pmic_core.c | 2 ++
drivers/mfd/stmpe-i2c.c | 4 ++--
drivers/mfd/stmpe.c | 2 +-
drivers/mfd/stmpe.h | 2 +-
drivers/mfd/tps65910.c | 10 +++++-----
include/linux/mfd/tps65910.h | 2 +-
17 files changed, 109 insertions(+), 93 deletions(-)
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/12] mfd: Bunch of clean-ups and checkpatch fixes
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
This patch-set contains a bunch of cleanups for issues that were
either noticed during recent patch submission review or that
checkpatch spotted.
drivers/mfd/88pm805.c | 2 +-
drivers/mfd/88pm860x-core.c | 37 +++++++++++++++++++------------
drivers/mfd/88pm860x-i2c.c | 3 ++-
drivers/mfd/aat2870-core.c | 5 ++++-
drivers/mfd/ab3100-core.c | 54 ++++++++++++++++++--------------------
drivers/mfd/ab8500-core.c | 49 ++++++++++++++++++-------------------
drivers/mfd/ab8500-debugfs.c | 14 ++++++------
drivers/mfd/arizona-core.c | 4 ++--
drivers/mfd/arizona-i2c.c | 5 +++--
drivers/mfd/arizona-spi.c | 3 ++-
drivers/mfd/arizona.h | 4 ++--
drivers/mfd/intel_soc_pmic_core.c | 2 ++
drivers/mfd/stmpe-i2c.c | 4 ++--
drivers/mfd/stmpe.c | 2 +-
drivers/mfd/stmpe.h | 2 +-
drivers/mfd/tps65910.c | 10 +++++-----
include/linux/mfd/tps65910.h | 2 +-
17 files changed, 109 insertions(+), 93 deletions(-)
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/12] mfd: ab8500-core: Remove pointless else in if statement
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Save a line of code (albeit, it's replaced by a blank line, but
still), as the else is superfluous.
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index cf2e6a1..857f19a 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -607,8 +607,8 @@ int ab8500_suspend(struct ab8500 *ab8500)
{
if (atomic_read(&ab8500->transfer_ongoing))
return -EINVAL;
- else
- return 0;
+
+ return 0;
}
static struct resource ab8500_gpadc_resources[] = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 01/12] mfd: ab8500-core: Remove pointless else in if statement
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Save a line of code (albeit, it's replaced by a blank line, but
still), as the else is superfluous.
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index cf2e6a1..857f19a 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -607,8 +607,8 @@ int ab8500_suspend(struct ab8500 *ab8500)
{
if (atomic_read(&ab8500->transfer_ongoing))
return -EINVAL;
- else
- return 0;
+
+ return 0;
}
static struct resource ab8500_gpadc_resources[] = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 02/12] mfd: ab8500-debugfs: Simplify invalid debugfs data checking
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Noticed during a coding review, if we reorganised the checking a
little, we can rid the code of a pointless 'else'. Whilst looking
for this particular code hunk I noticed another pointless 'else',
which I've subsequently fixed in this patch.
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-debugfs.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index e23fcba..f7f271c 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2503,14 +2503,14 @@ static ssize_t ab8500_gpadc_trig_timer_write(struct file *file,
if (err)
return err;
- if (user_trig_timer <= 255) {
- trig_timer = (u8) user_trig_timer;
- } else {
- dev_err(dev, "debugfs error input: "
- "should be beetween 0 to 255\n");
+ if (user_trig_timer & ~0xFF) {
+ dev_err(dev,
+ "debugfs error input: should be beetween 0 to 255\n");
return -EINVAL;
}
+ trig_timer = (u8) user_trig_timer;
+
return count;
}
@@ -2764,8 +2764,8 @@ static ssize_t show_irq(struct device *dev,
irq_index = name - irq_first;
if (irq_index >= num_irqs)
return -EINVAL;
- else
- return sprintf(buf, "%u\n", irq_count[irq_index]);
+
+ return sprintf(buf, "%u\n", irq_count[irq_index]);
}
static ssize_t ab8500_subscribe_write(struct file *file,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 02/12] mfd: ab8500-debugfs: Simplify invalid debugfs data checking
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Noticed during a coding review, if we reorganised the checking a
little, we can rid the code of a pointless 'else'. Whilst looking
for this particular code hunk I noticed another pointless 'else',
which I've subsequently fixed in this patch.
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-debugfs.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index e23fcba..f7f271c 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2503,14 +2503,14 @@ static ssize_t ab8500_gpadc_trig_timer_write(struct file *file,
if (err)
return err;
- if (user_trig_timer <= 255) {
- trig_timer = (u8) user_trig_timer;
- } else {
- dev_err(dev, "debugfs error input: "
- "should be beetween 0 to 255\n");
+ if (user_trig_timer & ~0xFF) {
+ dev_err(dev,
+ "debugfs error input: should be beetween 0 to 255\n");
return -EINVAL;
}
+ trig_timer = (u8) user_trig_timer;
+
return count;
}
@@ -2764,8 +2764,8 @@ static ssize_t show_irq(struct device *dev,
irq_index = name - irq_first;
if (irq_index >= num_irqs)
return -EINVAL;
- else
- return sprintf(buf, "%u\n", irq_count[irq_index]);
+
+ return sprintf(buf, "%u\n", irq_count[irq_index]);
}
static ssize_t ab8500_subscribe_write(struct file *file,
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 03/12] mfd: intel_soc_pmic: Rid compiler working for unused ACPI match table
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
If CONIFG_ACPI is not enabled we receive the following warning:
drivers/mfd/intel_soc_pmic_core.c:144:30:
warning: ‘intel_soc_pmic_acpi_match’ defined but not used
This patch rids it.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/intel_soc_pmic_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
index cddbf5a..2720922 100644
--- a/drivers/mfd/intel_soc_pmic_core.c
+++ b/drivers/mfd/intel_soc_pmic_core.c
@@ -141,11 +141,13 @@ static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id);
+#if defined(CONFIG_ACPI)
static struct acpi_device_id intel_soc_pmic_acpi_match[] = {
{"INT33FD", (kernel_ulong_t)&intel_soc_pmic_config_crc},
{ },
};
MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
+#endif
static struct i2c_driver intel_soc_pmic_i2c_driver = {
.driver = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 03/12] mfd: intel_soc_pmic: Rid compiler working for unused ACPI match table
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
If CONIFG_ACPI is not enabled we receive the following warning:
drivers/mfd/intel_soc_pmic_core.c:144:30:
warning: ?intel_soc_pmic_acpi_match? defined but not used
This patch rids it.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/intel_soc_pmic_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mfd/intel_soc_pmic_core.c b/drivers/mfd/intel_soc_pmic_core.c
index cddbf5a..2720922 100644
--- a/drivers/mfd/intel_soc_pmic_core.c
+++ b/drivers/mfd/intel_soc_pmic_core.c
@@ -141,11 +141,13 @@ static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id);
+#if defined(CONFIG_ACPI)
static struct acpi_device_id intel_soc_pmic_acpi_match[] = {
{"INT33FD", (kernel_ulong_t)&intel_soc_pmic_config_crc},
{ },
};
MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
+#endif
static struct i2c_driver intel_soc_pmic_i2c_driver = {
.driver = {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 04/12] mfd: stmpe: Rid data size incompatibility warn when building for 64bit
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Extinguishes:
../drivers/mfd/stmpe-i2c.c: In function ‘stmpe_i2c_probe’:
../drivers/mfd/stmpe-i2c.c:88:13:
warning: cast from pointer to integer of different size
partnum = (int)of_id->data;
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/stmpe-i2c.c | 4 ++--
drivers/mfd/stmpe.c | 2 +-
drivers/mfd/stmpe.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index a45f9c0..5c05403 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -68,7 +68,7 @@ MODULE_DEVICE_TABLE(of, stmpe_of_match);
static int
stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
{
- int partnum;
+ enum stmpe_partnum partnum;
const struct of_device_id *of_id;
i2c_ci.data = (void *)id;
@@ -85,7 +85,7 @@ stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
dev_info(&i2c->dev, "matching on node name, compatible is preferred\n");
partnum = id->driver_data;
} else
- partnum = (int)of_id->data;
+ partnum = (enum stmpe_partnum)of_id->data;
return stmpe_probe(&i2c_ci, partnum);
}
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 3b6bfa7..02a17c3 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1147,7 +1147,7 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
}
/* Called from client specific probe routines */
-int stmpe_probe(struct stmpe_client_info *ci, int partnum)
+int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)
{
struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev);
struct device_node *np = ci->dev->of_node;
diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h
index 9e4d21d..2d045f2 100644
--- a/drivers/mfd/stmpe.h
+++ b/drivers/mfd/stmpe.h
@@ -97,7 +97,7 @@ struct stmpe_client_info {
void (*init)(struct stmpe *stmpe);
};
-int stmpe_probe(struct stmpe_client_info *ci, int partnum);
+int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum);
int stmpe_remove(struct stmpe *stmpe);
#define STMPE_ICR_LSB_HIGH (1 << 2)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 04/12] mfd: stmpe: Rid data size incompatibility warn when building for 64bit
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Extinguishes:
../drivers/mfd/stmpe-i2c.c: In function ?stmpe_i2c_probe?:
../drivers/mfd/stmpe-i2c.c:88:13:
warning: cast from pointer to integer of different size
partnum = (int)of_id->data;
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/stmpe-i2c.c | 4 ++--
drivers/mfd/stmpe.c | 2 +-
drivers/mfd/stmpe.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index a45f9c0..5c05403 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -68,7 +68,7 @@ MODULE_DEVICE_TABLE(of, stmpe_of_match);
static int
stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
{
- int partnum;
+ enum stmpe_partnum partnum;
const struct of_device_id *of_id;
i2c_ci.data = (void *)id;
@@ -85,7 +85,7 @@ stmpe_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
dev_info(&i2c->dev, "matching on node name, compatible is preferred\n");
partnum = id->driver_data;
} else
- partnum = (int)of_id->data;
+ partnum = (enum stmpe_partnum)of_id->data;
return stmpe_probe(&i2c_ci, partnum);
}
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 3b6bfa7..02a17c3 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1147,7 +1147,7 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
}
/* Called from client specific probe routines */
-int stmpe_probe(struct stmpe_client_info *ci, int partnum)
+int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)
{
struct stmpe_platform_data *pdata = dev_get_platdata(ci->dev);
struct device_node *np = ci->dev->of_node;
diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h
index 9e4d21d..2d045f2 100644
--- a/drivers/mfd/stmpe.h
+++ b/drivers/mfd/stmpe.h
@@ -97,7 +97,7 @@ struct stmpe_client_info {
void (*init)(struct stmpe *stmpe);
};
-int stmpe_probe(struct stmpe_client_info *ci, int partnum);
+int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum);
int stmpe_remove(struct stmpe *stmpe);
#define STMPE_ICR_LSB_HIGH (1 << 2)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 05/12] mfd: arizona: Rid data size incompatibility warn when building for 64bit
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Extinguishes:
../drivers/mfd/arizona-core.c: In function ‘arizona_of_get_type’:
../drivers/mfd/arizona-core.c:505:10:
warning: cast from pointer to integer of different size
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/arizona-core.c | 4 ++--
drivers/mfd/arizona-i2c.c | 5 +++--
drivers/mfd/arizona-spi.c | 3 ++-
drivers/mfd/arizona.h | 4 ++--
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index b4f22e7..e9c3563 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -497,12 +497,12 @@ const struct dev_pm_ops arizona_pm_ops = {
EXPORT_SYMBOL_GPL(arizona_pm_ops);
#ifdef CONFIG_OF
-int arizona_of_get_type(struct device *dev)
+unsigned long arizona_of_get_type(struct device *dev)
{
const struct of_device_id *id = of_match_device(arizona_of_match, dev);
if (id)
- return (int)id->data;
+ return (unsigned long)id->data;
else
return 0;
}
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index beccb79..9d4156f 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -24,11 +24,12 @@
#include "arizona.h"
static int arizona_i2c_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
struct arizona *arizona;
const struct regmap_config *regmap_config;
- int ret, type;
+ unsigned long type;
+ int ret;
if (i2c->dev.of_node)
type = arizona_of_get_type(&i2c->dev);
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index 1ca554b..5145d78 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -28,7 +28,8 @@ static int arizona_spi_probe(struct spi_device *spi)
const struct spi_device_id *id = spi_get_device_id(spi);
struct arizona *arizona;
const struct regmap_config *regmap_config;
- int ret, type;
+ unsigned long type;
+ int ret;
if (spi->dev.of_node)
type = arizona_of_get_type(&spi->dev);
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h
index b4cef77..2951498 100644
--- a/drivers/mfd/arizona.h
+++ b/drivers/mfd/arizona.h
@@ -46,9 +46,9 @@ int arizona_irq_init(struct arizona *arizona);
int arizona_irq_exit(struct arizona *arizona);
#ifdef CONFIG_OF
-int arizona_of_get_type(struct device *dev);
+unsigned long arizona_of_get_type(struct device *dev);
#else
-static inline int arizona_of_get_type(struct device *dev)
+static inline unsigned long arizona_of_get_type(struct device *dev)
{
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 05/12] mfd: arizona: Rid data size incompatibility warn when building for 64bit
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Extinguishes:
../drivers/mfd/arizona-core.c: In function ?arizona_of_get_type?:
../drivers/mfd/arizona-core.c:505:10:
warning: cast from pointer to integer of different size
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/arizona-core.c | 4 ++--
drivers/mfd/arizona-i2c.c | 5 +++--
drivers/mfd/arizona-spi.c | 3 ++-
drivers/mfd/arizona.h | 4 ++--
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index b4f22e7..e9c3563 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -497,12 +497,12 @@ const struct dev_pm_ops arizona_pm_ops = {
EXPORT_SYMBOL_GPL(arizona_pm_ops);
#ifdef CONFIG_OF
-int arizona_of_get_type(struct device *dev)
+unsigned long arizona_of_get_type(struct device *dev)
{
const struct of_device_id *id = of_match_device(arizona_of_match, dev);
if (id)
- return (int)id->data;
+ return (unsigned long)id->data;
else
return 0;
}
diff --git a/drivers/mfd/arizona-i2c.c b/drivers/mfd/arizona-i2c.c
index beccb79..9d4156f 100644
--- a/drivers/mfd/arizona-i2c.c
+++ b/drivers/mfd/arizona-i2c.c
@@ -24,11 +24,12 @@
#include "arizona.h"
static int arizona_i2c_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
struct arizona *arizona;
const struct regmap_config *regmap_config;
- int ret, type;
+ unsigned long type;
+ int ret;
if (i2c->dev.of_node)
type = arizona_of_get_type(&i2c->dev);
diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index 1ca554b..5145d78 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -28,7 +28,8 @@ static int arizona_spi_probe(struct spi_device *spi)
const struct spi_device_id *id = spi_get_device_id(spi);
struct arizona *arizona;
const struct regmap_config *regmap_config;
- int ret, type;
+ unsigned long type;
+ int ret;
if (spi->dev.of_node)
type = arizona_of_get_type(&spi->dev);
diff --git a/drivers/mfd/arizona.h b/drivers/mfd/arizona.h
index b4cef77..2951498 100644
--- a/drivers/mfd/arizona.h
+++ b/drivers/mfd/arizona.h
@@ -46,9 +46,9 @@ int arizona_irq_init(struct arizona *arizona);
int arizona_irq_exit(struct arizona *arizona);
#ifdef CONFIG_OF
-int arizona_of_get_type(struct device *dev);
+unsigned long arizona_of_get_type(struct device *dev);
#else
-static inline int arizona_of_get_type(struct device *dev)
+static inline unsigned long arizona_of_get_type(struct device *dev)
{
return 0;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 06/12] mfd: tps65910: Rid data size incompatibility warn when building for 64bit
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Extinguishes:
../drivers/mfd/tps65910.c: In function ‘tps65910_parse_dt’:
../drivers/mfd/tps65910.c:404:14:
warning: cast from pointer to integer of different size
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/tps65910.c | 10 +++++-----
include/linux/mfd/tps65910.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index f9e42ea..f243e75 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -387,7 +387,7 @@ static const struct of_device_id tps65910_of_match[] = {
MODULE_DEVICE_TABLE(of, tps65910_of_match);
static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
- int *chip_id)
+ unsigned long *chip_id)
{
struct device_node *np = client->dev.of_node;
struct tps65910_board *board_info;
@@ -401,7 +401,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
return NULL;
}
- *chip_id = (int)match->data;
+ *chip_id = (unsigned long)match->data;
board_info = devm_kzalloc(&client->dev, sizeof(*board_info),
GFP_KERNEL);
@@ -431,7 +431,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
#else
static inline
struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
- int *chip_id)
+ unsigned long *chip_id)
{
return NULL;
}
@@ -453,14 +453,14 @@ static void tps65910_power_off(void)
}
static int tps65910_i2c_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
struct tps65910 *tps65910;
struct tps65910_board *pmic_plat_data;
struct tps65910_board *of_pmic_plat_data = NULL;
struct tps65910_platform_data *init_data;
+ unsigned long chip_id = id->driver_data;
int ret = 0;
- int chip_id = id->driver_data;
pmic_plat_data = dev_get_platdata(&i2c->dev);
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 16c2335..6483a6f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -892,7 +892,7 @@ struct tps65910 {
struct device *dev;
struct i2c_client *i2c_client;
struct regmap *regmap;
- unsigned int id;
+ unsigned long id;
/* Client devices */
struct tps65910_pmic *pmic;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 06/12] mfd: tps65910: Rid data size incompatibility warn when building for 64bit
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Extinguishes:
../drivers/mfd/tps65910.c: In function ?tps65910_parse_dt?:
../drivers/mfd/tps65910.c:404:14:
warning: cast from pointer to integer of different size
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/tps65910.c | 10 +++++-----
include/linux/mfd/tps65910.h | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index f9e42ea..f243e75 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -387,7 +387,7 @@ static const struct of_device_id tps65910_of_match[] = {
MODULE_DEVICE_TABLE(of, tps65910_of_match);
static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
- int *chip_id)
+ unsigned long *chip_id)
{
struct device_node *np = client->dev.of_node;
struct tps65910_board *board_info;
@@ -401,7 +401,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
return NULL;
}
- *chip_id = (int)match->data;
+ *chip_id = (unsigned long)match->data;
board_info = devm_kzalloc(&client->dev, sizeof(*board_info),
GFP_KERNEL);
@@ -431,7 +431,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
#else
static inline
struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
- int *chip_id)
+ unsigned long *chip_id)
{
return NULL;
}
@@ -453,14 +453,14 @@ static void tps65910_power_off(void)
}
static int tps65910_i2c_probe(struct i2c_client *i2c,
- const struct i2c_device_id *id)
+ const struct i2c_device_id *id)
{
struct tps65910 *tps65910;
struct tps65910_board *pmic_plat_data;
struct tps65910_board *of_pmic_plat_data = NULL;
struct tps65910_platform_data *init_data;
+ unsigned long chip_id = id->driver_data;
int ret = 0;
- int chip_id = id->driver_data;
pmic_plat_data = dev_get_platdata(&i2c->dev);
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 16c2335..6483a6f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -892,7 +892,7 @@ struct tps65910 {
struct device *dev;
struct i2c_client *i2c_client;
struct regmap *regmap;
- unsigned int id;
+ unsigned long id;
/* Client devices */
struct tps65910_pmic *pmic;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 07/12] mfd: 88pm805: msleep(1ms ~ 20ms) may not do what the caller intends
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
This code has been working since 2012, as limiting the time between
1ms and 3ms is unlikely to do any harm.
Soothes checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms;
see Documentation/timers/timers-howto.txt
#161: FILE: drivers/mfd/88pm805.c:161:
+ msleep(1);
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm805.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
index 64751c2..e9d5064 100644
--- a/drivers/mfd/88pm805.c
+++ b/drivers/mfd/88pm805.c
@@ -158,7 +158,7 @@ static int device_irq_init_805(struct pm80x_chip *chip)
* PM805_INT_STATUS is under 32K clock domain, so need to
* add proper delay before the next I2C register access.
*/
- msleep(1);
+ usleep_range(1000, 3000);
if (ret < 0)
goto out;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 07/12] mfd: 88pm805: msleep(1ms ~ 20ms) may not do what the caller intends
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
This code has been working since 2012, as limiting the time between
1ms and 3ms is unlikely to do any harm.
Soothes checkpatch warning:
WARNING: msleep < 20ms can sleep for up to 20ms;
see Documentation/timers/timers-howto.txt
#161: FILE: drivers/mfd/88pm805.c:161:
+ msleep(1);
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm805.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
index 64751c2..e9d5064 100644
--- a/drivers/mfd/88pm805.c
+++ b/drivers/mfd/88pm805.c
@@ -158,7 +158,7 @@ static int device_irq_init_805(struct pm80x_chip *chip)
* PM805_INT_STATUS is under 32K clock domain, so need to
* add proper delay before the next I2C register access.
*/
- msleep(1);
+ usleep_range(1000, 3000);
if (ret < 0)
goto out;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 08/12] mfd: 88pm860x-core: Repair formatting issues
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Fixes the following checkpatch warnings:
WARNING: please, no space before tabs
#5: FILE: drivers/mfd/88pm860x-core.c:5:
+ * ^IHaojian Zhuang <haojian.zhuang@marvell.com>$
WARNING: line over 80 characters
#143: FILE: drivers/mfd/88pm860x-core.c:143:
+ {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#153: FILE: drivers/mfd/88pm860x-core.c:153:
+ {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#154: FILE: drivers/mfd/88pm860x-core.c:154:
+ {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#155: FILE: drivers/mfd/88pm860x-core.c:155:
+ {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#156: FILE: drivers/mfd/88pm860x-core.c:156:
+ {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,},
WARNING: Avoid unnecessary line continuations
#571: FILE: drivers/mfd/88pm860x-core.c:571:
+ struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \
WARNING: line over 80 characters
#634: FILE: drivers/mfd/88pm860x-core.c:634:
+ ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT,
WARNING: Unnecessary parentheses - maybe == should be = ?
#874: FILE: drivers/mfd/88pm860x-core.c:874:
+ if ((pdata == NULL))
WARNING: quoted string split across lines
#1001: FILE: drivers/mfd/88pm860x-core.c:1001:
+ dev_err(chip->dev, "Failed to detect Marvell 88PM8607. "
+ "Chip ID: %02x\n", ret);
WARNING: quoted string split across lines
#1124: FILE: drivers/mfd/88pm860x-core.c:1124:
+ dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" "
+ "property\n");
total: 0 errors, 11 warnings, 1281 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm860x-core.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index bcfc9e8..3a26045 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -2,7 +2,8 @@
* Base driver for Marvell 88PM8607
*
* Copyright (C) 2009 Marvell International Ltd.
- * Haojian Zhuang <haojian.zhuang@marvell.com>
+ *
+ * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -140,7 +141,8 @@ static struct resource codec_resources[] = {
/* Headset insertion or removal */
{PM8607_IRQ_HEADSET, PM8607_IRQ_HEADSET, "headset", IORESOURCE_IRQ,},
/* Audio short */
- {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,},
+ {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short",
+ IORESOURCE_IRQ,},
};
static struct resource battery_resources[] = {
@@ -150,10 +152,14 @@ static struct resource battery_resources[] = {
static struct resource charger_resources[] = {
{PM8607_IRQ_CHG, PM8607_IRQ_CHG, "charger detect", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,},
- {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature",
+ IORESOURCE_IRQ,},
{PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,},
{PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,},
};
@@ -568,8 +574,8 @@ static struct irq_domain_ops pm860x_irq_domain_ops = {
static int device_irq_init(struct pm860x_chip *chip,
struct pm860x_platform_data *pdata)
{
- struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \
- : chip->companion;
+ struct i2c_client *i2c = (chip->id == CHIP_PM8607) ?
+ chip->client : chip->companion;
unsigned char status_buf[INT_STATUS_NUM];
unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT;
int data, mask, ret = -EINVAL;
@@ -631,8 +637,8 @@ static int device_irq_init(struct pm860x_chip *chip,
if (!chip->core_irq)
goto out;
- ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT,
- "88pm860x", chip);
+ ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq,
+ flags | IRQF_ONESHOT, "88pm860x", chip);
if (ret) {
dev_err(chip->dev, "Failed to request IRQ: %d\n", ret);
chip->core_irq = 0;
@@ -871,7 +877,7 @@ static void device_rtc_init(struct pm860x_chip *chip,
{
int ret;
- if ((pdata == NULL))
+ if (!pdata)
return;
rtc_devs[0].platform_data = pdata->rtc;
@@ -997,8 +1003,9 @@ static void device_8607_init(struct pm860x_chip *chip,
ret);
break;
default:
- dev_err(chip->dev, "Failed to detect Marvell 88PM8607. "
- "Chip ID: %02x\n", ret);
+ dev_err(chip->dev,
+ "Failed to detect Marvell 88PM8607. Chip ID: %02x\n",
+ ret);
goto out;
}
@@ -1120,8 +1127,8 @@ static int pm860x_dt_init(struct device_node *np,
ret = of_property_read_u32(np, "marvell,88pm860x-slave-addr",
&pdata->companion_addr);
if (ret) {
- dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" "
- "property\n");
+ dev_err(dev,
+ "Not found \"marvell,88pm860x-slave-addr\" property\n");
pdata->companion_addr = 0;
}
return 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 08/12] mfd: 88pm860x-core: Repair formatting issues
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Fixes the following checkpatch warnings:
WARNING: please, no space before tabs
#5: FILE: drivers/mfd/88pm860x-core.c:5:
+ * ^IHaojian Zhuang <haojian.zhuang@marvell.com>$
WARNING: line over 80 characters
#143: FILE: drivers/mfd/88pm860x-core.c:143:
+ {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#153: FILE: drivers/mfd/88pm860x-core.c:153:
+ {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#154: FILE: drivers/mfd/88pm860x-core.c:154:
+ {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#155: FILE: drivers/mfd/88pm860x-core.c:155:
+ {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,},
WARNING: line over 80 characters
#156: FILE: drivers/mfd/88pm860x-core.c:156:
+ {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,},
WARNING: Avoid unnecessary line continuations
#571: FILE: drivers/mfd/88pm860x-core.c:571:
+ struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \
WARNING: line over 80 characters
#634: FILE: drivers/mfd/88pm860x-core.c:634:
+ ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT,
WARNING: Unnecessary parentheses - maybe == should be = ?
#874: FILE: drivers/mfd/88pm860x-core.c:874:
+ if ((pdata == NULL))
WARNING: quoted string split across lines
#1001: FILE: drivers/mfd/88pm860x-core.c:1001:
+ dev_err(chip->dev, "Failed to detect Marvell 88PM8607. "
+ "Chip ID: %02x\n", ret);
WARNING: quoted string split across lines
#1124: FILE: drivers/mfd/88pm860x-core.c:1124:
+ dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" "
+ "property\n");
total: 0 errors, 11 warnings, 1281 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm860x-core.c | 37 ++++++++++++++++++++++---------------
1 file changed, 22 insertions(+), 15 deletions(-)
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index bcfc9e8..3a26045 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -2,7 +2,8 @@
* Base driver for Marvell 88PM8607
*
* Copyright (C) 2009 Marvell International Ltd.
- * Haojian Zhuang <haojian.zhuang@marvell.com>
+ *
+ * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -140,7 +141,8 @@ static struct resource codec_resources[] = {
/* Headset insertion or removal */
{PM8607_IRQ_HEADSET, PM8607_IRQ_HEADSET, "headset", IORESOURCE_IRQ,},
/* Audio short */
- {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short", IORESOURCE_IRQ,},
+ {PM8607_IRQ_AUDIO_SHORT, PM8607_IRQ_AUDIO_SHORT, "audio-short",
+ IORESOURCE_IRQ,},
};
static struct resource battery_resources[] = {
@@ -150,10 +152,14 @@ static struct resource battery_resources[] = {
static struct resource charger_resources[] = {
{PM8607_IRQ_CHG, PM8607_IRQ_CHG, "charger detect", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout", IORESOURCE_IRQ,},
- {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault", IORESOURCE_IRQ,},
- {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature", IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_DONE, PM8607_IRQ_CHG_DONE, "charging done",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_FAIL, PM8607_IRQ_CHG_FAIL, "charging timeout",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault",
+ IORESOURCE_IRQ,},
+ {PM8607_IRQ_GPADC1, PM8607_IRQ_GPADC1, "battery temperature",
+ IORESOURCE_IRQ,},
{PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,},
{PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage", IORESOURCE_IRQ,},
};
@@ -568,8 +574,8 @@ static struct irq_domain_ops pm860x_irq_domain_ops = {
static int device_irq_init(struct pm860x_chip *chip,
struct pm860x_platform_data *pdata)
{
- struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \
- : chip->companion;
+ struct i2c_client *i2c = (chip->id == CHIP_PM8607) ?
+ chip->client : chip->companion;
unsigned char status_buf[INT_STATUS_NUM];
unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT;
int data, mask, ret = -EINVAL;
@@ -631,8 +637,8 @@ static int device_irq_init(struct pm860x_chip *chip,
if (!chip->core_irq)
goto out;
- ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq, flags | IRQF_ONESHOT,
- "88pm860x", chip);
+ ret = request_threaded_irq(chip->core_irq, NULL, pm860x_irq,
+ flags | IRQF_ONESHOT, "88pm860x", chip);
if (ret) {
dev_err(chip->dev, "Failed to request IRQ: %d\n", ret);
chip->core_irq = 0;
@@ -871,7 +877,7 @@ static void device_rtc_init(struct pm860x_chip *chip,
{
int ret;
- if ((pdata == NULL))
+ if (!pdata)
return;
rtc_devs[0].platform_data = pdata->rtc;
@@ -997,8 +1003,9 @@ static void device_8607_init(struct pm860x_chip *chip,
ret);
break;
default:
- dev_err(chip->dev, "Failed to detect Marvell 88PM8607. "
- "Chip ID: %02x\n", ret);
+ dev_err(chip->dev,
+ "Failed to detect Marvell 88PM8607. Chip ID: %02x\n",
+ ret);
goto out;
}
@@ -1120,8 +1127,8 @@ static int pm860x_dt_init(struct device_node *np,
ret = of_property_read_u32(np, "marvell,88pm860x-slave-addr",
&pdata->companion_addr);
if (ret) {
- dev_err(dev, "Not found \"marvell,88pm860x-slave-addr\" "
- "property\n");
+ dev_err(dev,
+ "Not found \"marvell,88pm860x-slave-addr\" property\n");
pdata->companion_addr = 0;
}
return 0;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 09/12] mfd: 88pm860x-i2c: Repair 'space before tab' warning
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Fixes checkpatch warning:
WARNING: please, no space before tabs
#5: FILE: drivers/mfd/88pm860x-i2c.c:5:
+ * ^IHaojian Zhuang <haojian.zhuang@marvell.com>$
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm860x-i2c.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c
index ff8f803..a93b4d0 100644
--- a/drivers/mfd/88pm860x-i2c.c
+++ b/drivers/mfd/88pm860x-i2c.c
@@ -2,7 +2,8 @@
* I2C driver for Marvell 88PM860x
*
* Copyright (C) 2009 Marvell International Ltd.
- * Haojian Zhuang <haojian.zhuang@marvell.com>
+ *
+ * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 09/12] mfd: 88pm860x-i2c: Repair 'space before tab' warning
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Fixes checkpatch warning:
WARNING: please, no space before tabs
#5: FILE: drivers/mfd/88pm860x-i2c.c:5:
+ * ^IHaojian Zhuang <haojian.zhuang@marvell.com>$
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/88pm860x-i2c.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/88pm860x-i2c.c b/drivers/mfd/88pm860x-i2c.c
index ff8f803..a93b4d0 100644
--- a/drivers/mfd/88pm860x-i2c.c
+++ b/drivers/mfd/88pm860x-i2c.c
@@ -2,7 +2,8 @@
* I2C driver for Marvell 88PM860x
*
* Copyright (C) 2009 Marvell International Ltd.
- * Haojian Zhuang <haojian.zhuang@marvell.com>
+ *
+ * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 10/12] mfd: aat2870-core: Stop using obsolte simple_strtoul()
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Soothes checkpatch warning:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#306: FILE: drivers/mfd/aat2870-core.c:306:
+ addr = simple_strtoul(start, &start, 16);
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/aat2870-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 14d9542..4e6e03d 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -303,7 +303,10 @@ static ssize_t aat2870_reg_write_file(struct file *file,
while (*start == ' ')
start++;
- addr = simple_strtoul(start, &start, 16);
+ ret = kstrtoul(start, 16, &addr);
+ if (ret)
+ return ret;
+
if (addr >= AAT2870_REG_NUM) {
dev_err(aat2870->dev, "Invalid address, 0x%lx\n", addr);
return -EINVAL;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 10/12] mfd: aat2870-core: Stop using obsolte simple_strtoul()
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Soothes checkpatch warning:
WARNING: simple_strtoul is obsolete, use kstrtoul instead
#306: FILE: drivers/mfd/aat2870-core.c:306:
+ addr = simple_strtoul(start, &start, 16);
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/aat2870-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index 14d9542..4e6e03d 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -303,7 +303,10 @@ static ssize_t aat2870_reg_write_file(struct file *file,
while (*start == ' ')
start++;
- addr = simple_strtoul(start, &start, 16);
+ ret = kstrtoul(start, 16, &addr);
+ if (ret)
+ return ret;
+
if (addr >= AAT2870_REG_NUM) {
dev_err(aat2870->dev, "Invalid address, 0x%lx\n", addr);
return -EINVAL;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Corrects the following checkpatch gripes:
WARNING: quoted string split across lines
#95: FILE: drivers/mfd/ab3100-core.c:95:
+ "write error (write register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: quoted string split across lines
#139: FILE: drivers/mfd/ab3100-core.c:139:
+ "write error (write test register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: quoted string split across lines
#175: FILE: drivers/mfd/ab3100-core.c:175:
+ "write error (send register address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#193: FILE: drivers/mfd/ab3100-core.c:193:
+ "write error (read register) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#241: FILE: drivers/mfd/ab3100-core.c:241:
+ "write error (send first register address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#256: FILE: drivers/mfd/ab3100-core.c:256:
+ "write error (read register page) "
+ "%d bytes transferred (expected %d)\n",
WARNING: quoted string split across lines
#299: FILE: drivers/mfd/ab3100-core.c:299:
+ "write error (maskset send address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#314: FILE: drivers/mfd/ab3100-core.c:314:
+ "write error (maskset read register) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#334: FILE: drivers/mfd/ab3100-core.c:334:
+ "write error (write register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: please, no spaces at the start of a line
#374: FILE: drivers/mfd/ab3100-core.c:374:
+ return blocking_notifier_chain_unregister(&ab3100->event_subscribers,$
WARNING: Prefer seq_puts to seq_printf
#458: FILE: drivers/mfd/ab3100-core.c:458:
+ seq_printf(s, "AB3100 registers:\n");
WARNING: quoted string split across lines
#564: FILE: drivers/mfd/ab3100-core.c:564:
+ "debug write reg[0x%02x] with 0x%02x, "
+ "after readback: 0x%02x\n",
WARNING: quoted string split across lines
#723: FILE: drivers/mfd/ab3100-core.c:723:
+ "AB3100 P1E variant detected, "
+ "forcing chip to 32KHz\n");
WARNING: quoted string split across lines
#882: FILE: drivers/mfd/ab3100-core.c:882:
+ "could not communicate with the AB3100 analog "
+ "baseband chip\n");
WARNING: quoted string split across lines
#906: FILE: drivers/mfd/ab3100-core.c:906:
+ dev_err(&client->dev, "accepting it anyway. Please update "
+ "the driver.\n");
total: 0 errors, 15 warnings, 999 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab3100-core.c | 54 +++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 28 deletions(-)
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index b348ae5..4659ac1 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -91,8 +91,8 @@ static int ab3100_set_register_interruptible(struct ab3100 *ab3100,
err);
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
} else {
@@ -135,8 +135,8 @@ static int ab3100_set_test_register_interruptible(struct ab3100 *ab3100,
err);
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write test register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write test register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
} else {
@@ -171,8 +171,8 @@ static int ab3100_get_register_interruptible(struct ab3100 *ab3100,
goto get_reg_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (send register address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (send register address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_out_unlock;
@@ -189,8 +189,8 @@ static int ab3100_get_register_interruptible(struct ab3100 *ab3100,
goto get_reg_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (read register) "
- "%d bytes transferred (expected 1)\n",
+ "write error (read register)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_out_unlock;
@@ -237,8 +237,8 @@ static int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
goto get_reg_page_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (send first register address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (send first register address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_page_out_unlock;
@@ -252,8 +252,8 @@ static int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
goto get_reg_page_out_unlock;
} else if (err != numregs) {
dev_err(ab3100->dev,
- "write error (read register page) "
- "%d bytes transferred (expected %d)\n",
+ "write error (read register page)\n"
+ " %d bytes transferred (expected %d)\n",
err, numregs);
err = -EIO;
goto get_reg_page_out_unlock;
@@ -295,8 +295,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (maskset send address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (maskset send address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -310,8 +310,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (maskset read register) "
- "%d bytes transferred (expected 1)\n",
+ "write error (maskset read register)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -330,8 +330,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(ab3100_event_register);
int ab3100_event_unregister(struct ab3100 *ab3100,
struct notifier_block *nb)
{
- return blocking_notifier_chain_unregister(&ab3100->event_subscribers,
+ return blocking_notifier_chain_unregister(&ab3100->event_subscribers,
nb);
}
EXPORT_SYMBOL(ab3100_event_unregister);
@@ -455,7 +455,7 @@ static int ab3100_registers_print(struct seq_file *s, void *p)
u8 value;
u8 reg;
- seq_printf(s, "AB3100 registers:\n");
+ seq_puts(s, "AB3100 registers:\n");
for (reg = 0; reg < 0xff; reg++) {
ab3100_get_register_interruptible(ab3100, reg, &value);
@@ -560,8 +560,8 @@ static ssize_t ab3100_get_set_reg(struct file *file,
ab3100_get_register_interruptible(ab3100, user_reg, ®value);
dev_info(ab3100->dev,
- "debug write reg[0x%02x] with 0x%02x, "
- "after readback: 0x%02x\n",
+ "debug write reg[0x%02x]\n"
+ " with 0x%02x, after readback: 0x%02x\n",
user_reg, user_value, regvalue);
}
return buf_size;
@@ -719,8 +719,7 @@ static int ab3100_setup(struct ab3100 *ab3100)
*/
if (ab3100->chip_id == 0xc4) {
dev_warn(ab3100->dev,
- "AB3100 P1E variant detected, "
- "forcing chip to 32KHz\n");
+ "AB3100 P1E variant detected forcing chip to 32KHz\n");
err = ab3100_set_test_register_interruptible(ab3100,
0x02, 0x08);
}
@@ -878,8 +877,7 @@ static int ab3100_probe(struct i2c_client *client,
&ab3100->chip_id);
if (err) {
dev_err(&client->dev,
- "could not communicate with the AB3100 analog "
- "baseband chip\n");
+ "failed to communicate with AB3100 chip\n");
goto exit_no_detect;
}
@@ -902,8 +900,8 @@ static int ab3100_probe(struct i2c_client *client,
if (ids[i].id == 0x0) {
dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n",
ab3100->chip_id);
- dev_err(&client->dev, "accepting it anyway. Please update "
- "the driver.\n");
+ dev_err(&client->dev,
+ "accepting it anyway. Please update the driver.\n");
goto exit_no_detect;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Corrects the following checkpatch gripes:
WARNING: quoted string split across lines
#95: FILE: drivers/mfd/ab3100-core.c:95:
+ "write error (write register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: quoted string split across lines
#139: FILE: drivers/mfd/ab3100-core.c:139:
+ "write error (write test register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: quoted string split across lines
#175: FILE: drivers/mfd/ab3100-core.c:175:
+ "write error (send register address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#193: FILE: drivers/mfd/ab3100-core.c:193:
+ "write error (read register) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#241: FILE: drivers/mfd/ab3100-core.c:241:
+ "write error (send first register address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#256: FILE: drivers/mfd/ab3100-core.c:256:
+ "write error (read register page) "
+ "%d bytes transferred (expected %d)\n",
WARNING: quoted string split across lines
#299: FILE: drivers/mfd/ab3100-core.c:299:
+ "write error (maskset send address) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#314: FILE: drivers/mfd/ab3100-core.c:314:
+ "write error (maskset read register) "
+ "%d bytes transferred (expected 1)\n",
WARNING: quoted string split across lines
#334: FILE: drivers/mfd/ab3100-core.c:334:
+ "write error (write register) "
+ "%d bytes transferred (expected 2)\n",
WARNING: please, no spaces at the start of a line
#374: FILE: drivers/mfd/ab3100-core.c:374:
+ return blocking_notifier_chain_unregister(&ab3100->event_subscribers,$
WARNING: Prefer seq_puts to seq_printf
#458: FILE: drivers/mfd/ab3100-core.c:458:
+ seq_printf(s, "AB3100 registers:\n");
WARNING: quoted string split across lines
#564: FILE: drivers/mfd/ab3100-core.c:564:
+ "debug write reg[0x%02x] with 0x%02x, "
+ "after readback: 0x%02x\n",
WARNING: quoted string split across lines
#723: FILE: drivers/mfd/ab3100-core.c:723:
+ "AB3100 P1E variant detected, "
+ "forcing chip to 32KHz\n");
WARNING: quoted string split across lines
#882: FILE: drivers/mfd/ab3100-core.c:882:
+ "could not communicate with the AB3100 analog "
+ "baseband chip\n");
WARNING: quoted string split across lines
#906: FILE: drivers/mfd/ab3100-core.c:906:
+ dev_err(&client->dev, "accepting it anyway. Please update "
+ "the driver.\n");
total: 0 errors, 15 warnings, 999 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab3100-core.c | 54 +++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 28 deletions(-)
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index b348ae5..4659ac1 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -91,8 +91,8 @@ static int ab3100_set_register_interruptible(struct ab3100 *ab3100,
err);
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
} else {
@@ -135,8 +135,8 @@ static int ab3100_set_test_register_interruptible(struct ab3100 *ab3100,
err);
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write test register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write test register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
} else {
@@ -171,8 +171,8 @@ static int ab3100_get_register_interruptible(struct ab3100 *ab3100,
goto get_reg_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (send register address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (send register address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_out_unlock;
@@ -189,8 +189,8 @@ static int ab3100_get_register_interruptible(struct ab3100 *ab3100,
goto get_reg_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (read register) "
- "%d bytes transferred (expected 1)\n",
+ "write error (read register)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_out_unlock;
@@ -237,8 +237,8 @@ static int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
goto get_reg_page_out_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (send first register address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (send first register address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_reg_page_out_unlock;
@@ -252,8 +252,8 @@ static int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
goto get_reg_page_out_unlock;
} else if (err != numregs) {
dev_err(ab3100->dev,
- "write error (read register page) "
- "%d bytes transferred (expected %d)\n",
+ "write error (read register page)\n"
+ " %d bytes transferred (expected %d)\n",
err, numregs);
err = -EIO;
goto get_reg_page_out_unlock;
@@ -295,8 +295,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (maskset send address) "
- "%d bytes transferred (expected 1)\n",
+ "write error (maskset send address)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -310,8 +310,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 1) {
dev_err(ab3100->dev,
- "write error (maskset read register) "
- "%d bytes transferred (expected 1)\n",
+ "write error (maskset read register)\n"
+ " %d bytes transferred (expected 1)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -330,8 +330,8 @@ static int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
goto get_maskset_unlock;
} else if (err != 2) {
dev_err(ab3100->dev,
- "write error (write register) "
- "%d bytes transferred (expected 2)\n",
+ "write error (write register)\n"
+ " %d bytes transferred (expected 2)\n",
err);
err = -EIO;
goto get_maskset_unlock;
@@ -371,7 +371,7 @@ EXPORT_SYMBOL(ab3100_event_register);
int ab3100_event_unregister(struct ab3100 *ab3100,
struct notifier_block *nb)
{
- return blocking_notifier_chain_unregister(&ab3100->event_subscribers,
+ return blocking_notifier_chain_unregister(&ab3100->event_subscribers,
nb);
}
EXPORT_SYMBOL(ab3100_event_unregister);
@@ -455,7 +455,7 @@ static int ab3100_registers_print(struct seq_file *s, void *p)
u8 value;
u8 reg;
- seq_printf(s, "AB3100 registers:\n");
+ seq_puts(s, "AB3100 registers:\n");
for (reg = 0; reg < 0xff; reg++) {
ab3100_get_register_interruptible(ab3100, reg, &value);
@@ -560,8 +560,8 @@ static ssize_t ab3100_get_set_reg(struct file *file,
ab3100_get_register_interruptible(ab3100, user_reg, ®value);
dev_info(ab3100->dev,
- "debug write reg[0x%02x] with 0x%02x, "
- "after readback: 0x%02x\n",
+ "debug write reg[0x%02x]\n"
+ " with 0x%02x, after readback: 0x%02x\n",
user_reg, user_value, regvalue);
}
return buf_size;
@@ -719,8 +719,7 @@ static int ab3100_setup(struct ab3100 *ab3100)
*/
if (ab3100->chip_id == 0xc4) {
dev_warn(ab3100->dev,
- "AB3100 P1E variant detected, "
- "forcing chip to 32KHz\n");
+ "AB3100 P1E variant detected forcing chip to 32KHz\n");
err = ab3100_set_test_register_interruptible(ab3100,
0x02, 0x08);
}
@@ -878,8 +877,7 @@ static int ab3100_probe(struct i2c_client *client,
&ab3100->chip_id);
if (err) {
dev_err(&client->dev,
- "could not communicate with the AB3100 analog "
- "baseband chip\n");
+ "failed to communicate with AB3100 chip\n");
goto exit_no_detect;
}
@@ -902,8 +900,8 @@ static int ab3100_probe(struct i2c_client *client,
if (ids[i].id == 0x0) {
dev_err(&client->dev, "unknown analog baseband chip id: 0x%x\n",
ab3100->chip_id);
- dev_err(&client->dev, "accepting it anyway. Please update "
- "the driver.\n");
+ dev_err(&client->dev,
+ "accepting it anyway. Please update the driver.\n");
goto exit_no_detect;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 12/12] mfd: ab8500-core: Resolve code style issues
2014-07-02 15:28 ` Lee Jones
@ 2014-07-02 15:28 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel, linux-kernel; +Cc: sameo, linus.walleij, Lee Jones
Soothes the following checkpatch warnings:
WARNING: line over 80 characters
#151: FILE: drivers/mfd/ab8500-core.c:151:
+ 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23,
ERROR: spaces required around that '=' (ctx:VxW)
#325: FILE: drivers/mfd/ab8500-core.c:325:
+ ret= mask_and_set_register_interruptible(ab8500, bank, reg,
^
WARNING: line over 80 characters
#418: FILE: drivers/mfd/ab8500-core.c:418:
+ else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
WARNING: line over 80 characters
#420: FILE: drivers/mfd/ab8500-core.c:420:
+ else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
ERROR: spaces required around that '==' (ctx:VxV)
#454: FILE: drivers/mfd/ab8500-core.c:454:
+ if ((i==3) && (*offset >= 24))
^
ERROR: code indent should use tabs where possible
#576: FILE: drivers/mfd/ab8500-core.c:576:
+ .map = ab8500_irq_map,$
WARNING: please, no spaces at the start of a line
#576: FILE: drivers/mfd/ab8500-core.c:576:
+ .map = ab8500_irq_map,$
ERROR: code indent should use tabs where possible
#577: FILE: drivers/mfd/ab8500-core.c:577:
+ .xlate = irq_domain_xlate_twocell,$
WARNING: please, no spaces at the start of a line
#577: FILE: drivers/mfd/ab8500-core.c:577:
+ .xlate = irq_domain_xlate_twocell,$
WARNING: char * array declaration might be better as static const
#1554: FILE: drivers/mfd/ab8500-core.c:1554:
+ static char *switch_off_status[] = {
WARNING: char * array declaration might be better as static const
#1563: FILE: drivers/mfd/ab8500-core.c:1563:
+ static char *turn_on_status[] = {
WARNING: sizeof *ab8500 should be sizeof(*ab8500)
#1582: FILE: drivers/mfd/ab8500-core.c:1582:
+ ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL);
ERROR: space required after that close brace '}'
#1639: FILE: drivers/mfd/ab8500-core.c:1639:
+ }/* Configure AB8500 or AB9540 IRQ */
WARNING: line over 80 characters
#1652: FILE: drivers/mfd/ab8500-core.c:1652:
+ ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1677: FILE: drivers/mfd/ab8500-core.c:1677:
+ printk(KERN_CONT " \"%s\"",
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1682: FILE: drivers/mfd/ab8500-core.c:1682:
+ printk(KERN_CONT "\n");
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1684: FILE: drivers/mfd/ab8500-core.c:1684:
+ printk(KERN_CONT " None\n");
WARNING: printk() should include KERN_ facility level
#1695: FILE: drivers/mfd/ab8500-core.c:1695:
+ printk("\"%s\" ", turn_on_status[i]);
WARNING: printk() should include KERN_ facility level
#1700: FILE: drivers/mfd/ab8500-core.c:1700:
+ printk("None\n");
total: 5 errors, 14 warnings, 1869 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-core.c | 45 ++++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 857f19a..ce48aa7 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -148,8 +148,8 @@ static const int ab9540_irq_regoffset[AB9540_NUM_IRQ_REGS] = {
/* AB8540 support */
static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = {
- 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23,
- 25, 26, 27, 28, 29, 30, 31,
+ 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22,
+ 23, 25, 26, 27, 28, 29, 30, 31,
};
static const char ab8500_version_str[][7] = {
@@ -322,7 +322,7 @@ static int ab8500_mask_and_set_register(struct device *dev,
struct ab8500 *ab8500 = dev_get_drvdata(dev->parent);
atomic_inc(&ab8500->transfer_ongoing);
- ret= mask_and_set_register_interruptible(ab8500, bank, reg,
+ ret = mask_and_set_register_interruptible(ab8500, bank, reg,
bitmask, bitvalues);
atomic_dec(&ab8500->transfer_ongoing);
return ret;
@@ -415,9 +415,11 @@ static void ab8500_irq_unmask(struct irq_data *data)
if (type & IRQ_TYPE_EDGE_FALLING) {
if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R)
ab8500->mask[index + 2] &= ~mask;
- else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
+ else if (offset >= AB9540_INT_GPIO50R &&
+ offset <= AB9540_INT_GPIO54R)
ab8500->mask[index + 1] &= ~mask;
- else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
+ else if (offset == AB8540_INT_GPIO43R ||
+ offset == AB8540_INT_GPIO44R)
/* Here the falling IRQ is one bit lower */
ab8500->mask[index] &= ~(mask << 1);
else
@@ -451,7 +453,7 @@ static void update_latch_offset(u8 *offset, int i)
/* Fix inconsistent ab8540 bit mapping... */
if (unlikely(*offset == 16))
*offset = 25;
- if ((i==3) && (*offset >= 24))
+ if ((i == 3) && (*offset >= 24))
*offset += 2;
}
@@ -573,8 +575,8 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
}
static struct irq_domain_ops ab8500_irq_ops = {
- .map = ab8500_irq_map,
- .xlate = irq_domain_xlate_twocell,
+ .map = ab8500_irq_map,
+ .xlate = irq_domain_xlate_twocell,
};
static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
@@ -1551,7 +1553,7 @@ static struct attribute_group ab9540_attr_group = {
static int ab8500_probe(struct platform_device *pdev)
{
- static char *switch_off_status[] = {
+ static const char *switch_off_status[] = {
"Swoff bit programming",
"Thermal protection activation",
"Vbat lower then BattOk falling threshold",
@@ -1560,7 +1562,7 @@ static int ab8500_probe(struct platform_device *pdev)
"Battery level lower than power on reset threshold",
"Power on key 1 pressed longer than 10 seconds",
"DB8500 thermal shutdown"};
- static char *turn_on_status[] = {
+ static const char *turn_on_status[] = {
"Battery rising (Vbat)",
"Power On Key 1 dbF",
"Power On Key 2 dbF",
@@ -1579,7 +1581,7 @@ static int ab8500_probe(struct platform_device *pdev)
int i;
u8 value;
- ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL);
+ ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL);
if (!ab8500)
return -ENOMEM;
@@ -1636,7 +1638,7 @@ static int ab8500_probe(struct platform_device *pdev)
ab8500->mask_size = AB8540_NUM_IRQ_REGS;
ab8500->irq_reg_offset = ab8540_irq_regoffset;
ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM;
- }/* Configure AB8500 or AB9540 IRQ */
+ } /* Configure AB8500 or AB9540 IRQ */
else if (is_ab9540(ab8500) || is_ab8505(ab8500)) {
ab8500->mask_size = AB9540_NUM_IRQ_REGS;
ab8500->irq_reg_offset = ab9540_irq_regoffset;
@@ -1646,10 +1648,12 @@ static int ab8500_probe(struct platform_device *pdev)
ab8500->irq_reg_offset = ab8500_irq_regoffset;
ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM;
}
- ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
+ ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
+ GFP_KERNEL);
if (!ab8500->mask)
return -ENOMEM;
- ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
+ ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
+ GFP_KERNEL);
if (!ab8500->oldmask)
return -ENOMEM;
@@ -1674,14 +1678,13 @@ static int ab8500_probe(struct platform_device *pdev)
if (value) {
for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) {
if (value & 1)
- printk(KERN_CONT " \"%s\"",
- switch_off_status[i]);
+ pr_cont(" \"%s\"", switch_off_status[i]);
value = value >> 1;
}
- printk(KERN_CONT "\n");
+ pr_cont("\n");
} else {
- printk(KERN_CONT " None\n");
+ pr_cont(" None\n");
}
ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK,
AB8500_TURN_ON_STATUS, &value);
@@ -1692,12 +1695,12 @@ static int ab8500_probe(struct platform_device *pdev)
if (value) {
for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) {
if (value & 1)
- printk("\"%s\" ", turn_on_status[i]);
+ pr_cont("\"%s\" ", turn_on_status[i]);
value = value >> 1;
}
- printk("\n");
+ pr_cont("\n");
} else {
- printk("None\n");
+ pr_cont("None\n");
}
if (plat && plat->init)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* [PATCH 12/12] mfd: ab8500-core: Resolve code style issues
@ 2014-07-02 15:28 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-02 15:28 UTC (permalink / raw)
To: linux-arm-kernel
Soothes the following checkpatch warnings:
WARNING: line over 80 characters
#151: FILE: drivers/mfd/ab8500-core.c:151:
+ 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23,
ERROR: spaces required around that '=' (ctx:VxW)
#325: FILE: drivers/mfd/ab8500-core.c:325:
+ ret= mask_and_set_register_interruptible(ab8500, bank, reg,
^
WARNING: line over 80 characters
#418: FILE: drivers/mfd/ab8500-core.c:418:
+ else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
WARNING: line over 80 characters
#420: FILE: drivers/mfd/ab8500-core.c:420:
+ else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
ERROR: spaces required around that '==' (ctx:VxV)
#454: FILE: drivers/mfd/ab8500-core.c:454:
+ if ((i==3) && (*offset >= 24))
^
ERROR: code indent should use tabs where possible
#576: FILE: drivers/mfd/ab8500-core.c:576:
+ .map = ab8500_irq_map,$
WARNING: please, no spaces at the start of a line
#576: FILE: drivers/mfd/ab8500-core.c:576:
+ .map = ab8500_irq_map,$
ERROR: code indent should use tabs where possible
#577: FILE: drivers/mfd/ab8500-core.c:577:
+ .xlate = irq_domain_xlate_twocell,$
WARNING: please, no spaces at the start of a line
#577: FILE: drivers/mfd/ab8500-core.c:577:
+ .xlate = irq_domain_xlate_twocell,$
WARNING: char * array declaration might be better as static const
#1554: FILE: drivers/mfd/ab8500-core.c:1554:
+ static char *switch_off_status[] = {
WARNING: char * array declaration might be better as static const
#1563: FILE: drivers/mfd/ab8500-core.c:1563:
+ static char *turn_on_status[] = {
WARNING: sizeof *ab8500 should be sizeof(*ab8500)
#1582: FILE: drivers/mfd/ab8500-core.c:1582:
+ ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL);
ERROR: space required after that close brace '}'
#1639: FILE: drivers/mfd/ab8500-core.c:1639:
+ }/* Configure AB8500 or AB9540 IRQ */
WARNING: line over 80 characters
#1652: FILE: drivers/mfd/ab8500-core.c:1652:
+ ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1677: FILE: drivers/mfd/ab8500-core.c:1677:
+ printk(KERN_CONT " \"%s\"",
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1682: FILE: drivers/mfd/ab8500-core.c:1682:
+ printk(KERN_CONT "\n");
WARNING: Prefer [subsystem eg: netdev]_cont([subsystem]dev, ... then dev_cont(dev, ... then pr_cont(... to printk(KERN_CONT ...
#1684: FILE: drivers/mfd/ab8500-core.c:1684:
+ printk(KERN_CONT " None\n");
WARNING: printk() should include KERN_ facility level
#1695: FILE: drivers/mfd/ab8500-core.c:1695:
+ printk("\"%s\" ", turn_on_status[i]);
WARNING: printk() should include KERN_ facility level
#1700: FILE: drivers/mfd/ab8500-core.c:1700:
+ printk("None\n");
total: 5 errors, 14 warnings, 1869 lines checked
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/mfd/ab8500-core.c | 45 ++++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 857f19a..ce48aa7 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -148,8 +148,8 @@ static const int ab9540_irq_regoffset[AB9540_NUM_IRQ_REGS] = {
/* AB8540 support */
static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = {
- 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23,
- 25, 26, 27, 28, 29, 30, 31,
+ 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22,
+ 23, 25, 26, 27, 28, 29, 30, 31,
};
static const char ab8500_version_str[][7] = {
@@ -322,7 +322,7 @@ static int ab8500_mask_and_set_register(struct device *dev,
struct ab8500 *ab8500 = dev_get_drvdata(dev->parent);
atomic_inc(&ab8500->transfer_ongoing);
- ret= mask_and_set_register_interruptible(ab8500, bank, reg,
+ ret = mask_and_set_register_interruptible(ab8500, bank, reg,
bitmask, bitvalues);
atomic_dec(&ab8500->transfer_ongoing);
return ret;
@@ -415,9 +415,11 @@ static void ab8500_irq_unmask(struct irq_data *data)
if (type & IRQ_TYPE_EDGE_FALLING) {
if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R)
ab8500->mask[index + 2] &= ~mask;
- else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R)
+ else if (offset >= AB9540_INT_GPIO50R &&
+ offset <= AB9540_INT_GPIO54R)
ab8500->mask[index + 1] &= ~mask;
- else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R)
+ else if (offset == AB8540_INT_GPIO43R ||
+ offset == AB8540_INT_GPIO44R)
/* Here the falling IRQ is one bit lower */
ab8500->mask[index] &= ~(mask << 1);
else
@@ -451,7 +453,7 @@ static void update_latch_offset(u8 *offset, int i)
/* Fix inconsistent ab8540 bit mapping... */
if (unlikely(*offset == 16))
*offset = 25;
- if ((i==3) && (*offset >= 24))
+ if ((i == 3) && (*offset >= 24))
*offset += 2;
}
@@ -573,8 +575,8 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq,
}
static struct irq_domain_ops ab8500_irq_ops = {
- .map = ab8500_irq_map,
- .xlate = irq_domain_xlate_twocell,
+ .map = ab8500_irq_map,
+ .xlate = irq_domain_xlate_twocell,
};
static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
@@ -1551,7 +1553,7 @@ static struct attribute_group ab9540_attr_group = {
static int ab8500_probe(struct platform_device *pdev)
{
- static char *switch_off_status[] = {
+ static const char *switch_off_status[] = {
"Swoff bit programming",
"Thermal protection activation",
"Vbat lower then BattOk falling threshold",
@@ -1560,7 +1562,7 @@ static int ab8500_probe(struct platform_device *pdev)
"Battery level lower than power on reset threshold",
"Power on key 1 pressed longer than 10 seconds",
"DB8500 thermal shutdown"};
- static char *turn_on_status[] = {
+ static const char *turn_on_status[] = {
"Battery rising (Vbat)",
"Power On Key 1 dbF",
"Power On Key 2 dbF",
@@ -1579,7 +1581,7 @@ static int ab8500_probe(struct platform_device *pdev)
int i;
u8 value;
- ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL);
+ ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL);
if (!ab8500)
return -ENOMEM;
@@ -1636,7 +1638,7 @@ static int ab8500_probe(struct platform_device *pdev)
ab8500->mask_size = AB8540_NUM_IRQ_REGS;
ab8500->irq_reg_offset = ab8540_irq_regoffset;
ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM;
- }/* Configure AB8500 or AB9540 IRQ */
+ } /* Configure AB8500 or AB9540 IRQ */
else if (is_ab9540(ab8500) || is_ab8505(ab8500)) {
ab8500->mask_size = AB9540_NUM_IRQ_REGS;
ab8500->irq_reg_offset = ab9540_irq_regoffset;
@@ -1646,10 +1648,12 @@ static int ab8500_probe(struct platform_device *pdev)
ab8500->irq_reg_offset = ab8500_irq_regoffset;
ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM;
}
- ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
+ ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
+ GFP_KERNEL);
if (!ab8500->mask)
return -ENOMEM;
- ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL);
+ ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size,
+ GFP_KERNEL);
if (!ab8500->oldmask)
return -ENOMEM;
@@ -1674,14 +1678,13 @@ static int ab8500_probe(struct platform_device *pdev)
if (value) {
for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) {
if (value & 1)
- printk(KERN_CONT " \"%s\"",
- switch_off_status[i]);
+ pr_cont(" \"%s\"", switch_off_status[i]);
value = value >> 1;
}
- printk(KERN_CONT "\n");
+ pr_cont("\n");
} else {
- printk(KERN_CONT " None\n");
+ pr_cont(" None\n");
}
ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK,
AB8500_TURN_ON_STATUS, &value);
@@ -1692,12 +1695,12 @@ static int ab8500_probe(struct platform_device *pdev)
if (value) {
for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) {
if (value & 1)
- printk("\"%s\" ", turn_on_status[i]);
+ pr_cont("\"%s\" ", turn_on_status[i]);
value = value >> 1;
}
- printk("\n");
+ pr_cont("\n");
} else {
- printk("None\n");
+ pr_cont("None\n");
}
if (plat && plat->init)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 38+ messages in thread
* Re: [PATCH 01/12] mfd: ab8500-core: Remove pointless else in if statement
2014-07-02 15:28 ` Lee Jones
@ 2014-07-04 19:54 ` Linus Walleij
-1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:54 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Save a line of code (albeit, it's replaced by a blank line, but
> still), as the else is superfluous.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 01/12] mfd: ab8500-core: Remove pointless else in if statement
@ 2014-07-04 19:54 ` Linus Walleij
0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:54 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Save a line of code (albeit, it's replaced by a blank line, but
> still), as the else is superfluous.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 02/12] mfd: ab8500-debugfs: Simplify invalid debugfs data checking
2014-07-02 15:28 ` Lee Jones
@ 2014-07-04 19:55 ` Linus Walleij
-1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:55 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Noticed during a coding review, if we reorganised the checking a
> little, we can rid the code of a pointless 'else'. Whilst looking
> for this particular code hunk I noticed another pointless 'else',
> which I've subsequently fixed in this patch.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 02/12] mfd: ab8500-debugfs: Simplify invalid debugfs data checking
@ 2014-07-04 19:55 ` Linus Walleij
0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:55 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Noticed during a coding review, if we reorganised the checking a
> little, we can rid the code of a pointless 'else'. Whilst looking
> for this particular code hunk I noticed another pointless 'else',
> which I've subsequently fixed in this patch.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 04/12] mfd: stmpe: Rid data size incompatibility warn when building for 64bit
2014-07-02 15:28 ` Lee Jones
@ 2014-07-04 19:57 ` Linus Walleij
-1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:57 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Extinguishes:
>
> ../drivers/mfd/stmpe-i2c.c: In function ‘stmpe_i2c_probe’:
> ../drivers/mfd/stmpe-i2c.c:88:13:
> warning: cast from pointer to integer of different size
> partnum = (int)of_id->data;
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Not to mention that it uses the enum where the enum is due.
Good patch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 04/12] mfd: stmpe: Rid data size incompatibility warn when building for 64bit
@ 2014-07-04 19:57 ` Linus Walleij
0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:57 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Extinguishes:
>
> ../drivers/mfd/stmpe-i2c.c: In function ?stmpe_i2c_probe?:
> ../drivers/mfd/stmpe-i2c.c:88:13:
> warning: cast from pointer to integer of different size
> partnum = (int)of_id->data;
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Not to mention that it uses the enum where the enum is due.
Good patch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
2014-07-02 15:28 ` Lee Jones
@ 2014-07-04 19:58 ` Linus Walleij
-1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:58 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Corrects the following checkpatch gripes:
Fix subject line ;-)
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
@ 2014-07-04 19:58 ` Linus Walleij
0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:58 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Corrects the following checkpatch gripes:
Fix subject line ;-)
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 12/12] mfd: ab8500-core: Resolve code style issues
2014-07-02 15:28 ` Lee Jones
@ 2014-07-04 19:58 ` Linus Walleij
-1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:58 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Soothes the following checkpatch warnings:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 12/12] mfd: ab8500-core: Resolve code style issues
@ 2014-07-04 19:58 ` Linus Walleij
0 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2014-07-04 19:58 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Soothes the following checkpatch warnings:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 38+ messages in thread
* Re: [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
2014-07-04 19:58 ` Linus Walleij
@ 2014-07-07 12:50 ` Lee Jones
-1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-07 12:50 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-arm-kernel, linux-kernel, Samuel Ortiz
On Fri, 04 Jul 2014, Linus Walleij wrote:
> On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > Corrects the following checkpatch gripes:
>
> Fix subject line ;-)
The irony!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 38+ messages in thread
* [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems
@ 2014-07-07 12:50 ` Lee Jones
0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2014-07-07 12:50 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 04 Jul 2014, Linus Walleij wrote:
> On Wed, Jul 2, 2014 at 5:28 PM, Lee Jones <lee.jones@linaro.org> wrote:
>
> > Corrects the following checkpatch gripes:
>
> Fix subject line ;-)
The irony!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 38+ messages in thread
end of thread, other threads:[~2014-07-07 12:50 UTC | newest]
Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 15:28 [PATCH 01/12] mfd: Bunch of clean-ups and checkpatch fixes Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 01/12] mfd: ab8500-core: Remove pointless else in if statement Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-04 19:54 ` Linus Walleij
2014-07-04 19:54 ` Linus Walleij
2014-07-02 15:28 ` [PATCH 02/12] mfd: ab8500-debugfs: Simplify invalid debugfs data checking Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-04 19:55 ` Linus Walleij
2014-07-04 19:55 ` Linus Walleij
2014-07-02 15:28 ` [PATCH 03/12] mfd: intel_soc_pmic: Rid compiler working for unused ACPI match table Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 04/12] mfd: stmpe: Rid data size incompatibility warn when building for 64bit Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-04 19:57 ` Linus Walleij
2014-07-04 19:57 ` Linus Walleij
2014-07-02 15:28 ` [PATCH 05/12] mfd: arizona: " Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 06/12] mfd: tps65910: " Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 07/12] mfd: 88pm805: msleep(1ms ~ 20ms) may not do what the caller intends Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 08/12] mfd: 88pm860x-core: Repair formatting issues Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 09/12] mfd: 88pm860x-i2c: Repair 'space before tab' warning Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 10/12] mfd: aat2870-core: Stop using obsolte simple_strtoul() Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-02 15:28 ` [PATCH 11/12] mfd: ab3100-core: Correct code sytle problems Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-04 19:58 ` Linus Walleij
2014-07-04 19:58 ` Linus Walleij
2014-07-07 12:50 ` Lee Jones
2014-07-07 12:50 ` Lee Jones
2014-07-02 15:28 ` [PATCH 12/12] mfd: ab8500-core: Resolve code style issues Lee Jones
2014-07-02 15:28 ` Lee Jones
2014-07-04 19:58 ` Linus Walleij
2014-07-04 19:58 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.