diff options
author | Lee Jones <lee.jones@linaro.org> | 2015-10-28 05:15:02 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-01-14 03:43:54 -0500 |
commit | 500e69a1011d66897a08e000d92bcfd39372337e (patch) | |
tree | d2ccdffd855c539361a026cef0e1641b7e8d95e0 /drivers/mfd | |
parent | 845b76f891999f98b7acb439768c9d50959d29e1 (diff) |
mfd: ab8500-core: Fix many warnings reported by Checkpatch
WARNING: Block comments use a trailing */ on a separate line
+ * */
WARNING: Block comments use a trailing */ on a separate line
+ * bank on higher 8 bits and reg in lower */
WARNING: Block comments use a trailing */ on a separate line
+ * bank on higher 8 bits and reg in lower */
WARNING: suspect code indent for conditional statements (8, 24)
+ if (unlikely(*offset == 17))
+ *offset = 24;
WARNING: suspect code indent for conditional statements (8, 24)
+ if (unlikely(*offset == 16))
+ *offset = 25;
WARNING: suspect code indent for conditional statements (8, 24)
+ if ((i == 3) && (*offset >= 24))
+ *offset += 2;
WARNING: ENOSYS means 'invalid syscall nr' and nothing else
+ return -ENOSYS;
WARNING: static const char * array should probably be static const char * const
+ static const char *switch_off_status[] = {
WARNING: static const char * array should probably be static const char * const
+ static const char *turn_on_status[] = {
total: 0 errors, 9 warnings, 1867 lines checked
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/ab8500-core.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 582d3587f56a..f3d689176fc2 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c | |||
@@ -113,7 +113,7 @@ | |||
113 | #define AB8500_SWITCH_OFF_STATUS 0x00 | 113 | #define AB8500_SWITCH_OFF_STATUS 0x00 |
114 | 114 | ||
115 | #define AB8500_TURN_ON_STATUS 0x00 | 115 | #define AB8500_TURN_ON_STATUS 0x00 |
116 | #define AB8505_TURN_ON_STATUS_2 0x04 | 116 | #define AB8505_TURN_ON_STATUS_2 0x04 |
117 | 117 | ||
118 | #define AB8500_CH_USBCH_STAT1_REG 0x02 | 118 | #define AB8500_CH_USBCH_STAT1_REG 0x02 |
119 | #define VBUS_DET_DBNC100 0x02 | 119 | #define VBUS_DET_DBNC100 0x02 |
@@ -211,7 +211,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank, | |||
211 | /* | 211 | /* |
212 | * Put the u8 bank and u8 register together into a an u16. | 212 | * Put the u8 bank and u8 register together into a an u16. |
213 | * The bank on higher 8 bits and register in lower 8 bits. | 213 | * The bank on higher 8 bits and register in lower 8 bits. |
214 | * */ | 214 | */ |
215 | u16 addr = ((u16)bank) << 8 | reg; | 215 | u16 addr = ((u16)bank) << 8 | reg; |
216 | 216 | ||
217 | dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); | 217 | dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); |
@@ -243,8 +243,6 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, | |||
243 | u8 reg, u8 *value) | 243 | u8 reg, u8 *value) |
244 | { | 244 | { |
245 | int ret; | 245 | int ret; |
246 | /* put the u8 bank and u8 reg together into a an u16. | ||
247 | * bank on higher 8 bits and reg in lower */ | ||
248 | u16 addr = ((u16)bank) << 8 | reg; | 246 | u16 addr = ((u16)bank) << 8 | reg; |
249 | 247 | ||
250 | mutex_lock(&ab8500->lock); | 248 | mutex_lock(&ab8500->lock); |
@@ -278,8 +276,6 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank, | |||
278 | u8 reg, u8 bitmask, u8 bitvalues) | 276 | u8 reg, u8 bitmask, u8 bitvalues) |
279 | { | 277 | { |
280 | int ret; | 278 | int ret; |
281 | /* put the u8 bank and u8 reg together into a an u16. | ||
282 | * bank on higher 8 bits and reg in lower */ | ||
283 | u16 addr = ((u16)bank) << 8 | reg; | 279 | u16 addr = ((u16)bank) << 8 | reg; |
284 | 280 | ||
285 | mutex_lock(&ab8500->lock); | 281 | mutex_lock(&ab8500->lock); |
@@ -449,12 +445,12 @@ static void update_latch_offset(u8 *offset, int i) | |||
449 | { | 445 | { |
450 | /* Fix inconsistent ITFromLatch25 bit mapping... */ | 446 | /* Fix inconsistent ITFromLatch25 bit mapping... */ |
451 | if (unlikely(*offset == 17)) | 447 | if (unlikely(*offset == 17)) |
452 | *offset = 24; | 448 | *offset = 24; |
453 | /* Fix inconsistent ab8540 bit mapping... */ | 449 | /* Fix inconsistent ab8540 bit mapping... */ |
454 | if (unlikely(*offset == 16)) | 450 | if (unlikely(*offset == 16)) |
455 | *offset = 25; | 451 | *offset = 25; |
456 | if ((i == 3) && (*offset >= 24)) | 452 | if ((i == 3) && (*offset >= 24)) |
457 | *offset += 2; | 453 | *offset += 2; |
458 | } | 454 | } |
459 | 455 | ||
460 | static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, | 456 | static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, |
@@ -590,12 +586,12 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) | |||
590 | 586 | ||
591 | /* If ->irq_base is zero this will give a linear mapping */ | 587 | /* If ->irq_base is zero this will give a linear mapping */ |
592 | ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node, | 588 | ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node, |
593 | num_irqs, 0, | 589 | num_irqs, 0, |
594 | &ab8500_irq_ops, ab8500); | 590 | &ab8500_irq_ops, ab8500); |
595 | 591 | ||
596 | if (!ab8500->domain) { | 592 | if (!ab8500->domain) { |
597 | dev_err(ab8500->dev, "Failed to create irqdomain\n"); | 593 | dev_err(ab8500->dev, "Failed to create irqdomain\n"); |
598 | return -ENOSYS; | 594 | return -ENODEV; |
599 | } | 595 | } |
600 | 596 | ||
601 | return 0; | 597 | return 0; |
@@ -1073,7 +1069,7 @@ static struct attribute_group ab9540_attr_group = { | |||
1073 | 1069 | ||
1074 | static int ab8500_probe(struct platform_device *pdev) | 1070 | static int ab8500_probe(struct platform_device *pdev) |
1075 | { | 1071 | { |
1076 | static const char *switch_off_status[] = { | 1072 | static const char * const switch_off_status[] = { |
1077 | "Swoff bit programming", | 1073 | "Swoff bit programming", |
1078 | "Thermal protection activation", | 1074 | "Thermal protection activation", |
1079 | "Vbat lower then BattOk falling threshold", | 1075 | "Vbat lower then BattOk falling threshold", |
@@ -1082,7 +1078,7 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1082 | "Battery level lower than power on reset threshold", | 1078 | "Battery level lower than power on reset threshold", |
1083 | "Power on key 1 pressed longer than 10 seconds", | 1079 | "Power on key 1 pressed longer than 10 seconds", |
1084 | "DB8500 thermal shutdown"}; | 1080 | "DB8500 thermal shutdown"}; |
1085 | static const char *turn_on_status[] = { | 1081 | static const char * const turn_on_status[] = { |
1086 | "Battery rising (Vbat)", | 1082 | "Battery rising (Vbat)", |
1087 | "Power On Key 1 dbF", | 1083 | "Power On Key 1 dbF", |
1088 | "Power On Key 2 dbF", | 1084 | "Power On Key 2 dbF", |