diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-05-08 09:11:37 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-09 11:38:12 -0400 |
commit | 7ccf40b1a1aa060cc0c95bf00cf66f9e88636404 (patch) | |
tree | 37c62ecc04b29f859837178c9411a77c67a4ae27 /drivers/mfd | |
parent | cd63a8943a3a649325a3a24a472f0583836031a3 (diff) |
mfd: ab8500-core: Resolve code style issues
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
Reviewed-by: 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 | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 857f19ac4bd8..ce48aa72bb42 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] = { | |||
148 | 148 | ||
149 | /* AB8540 support */ | 149 | /* AB8540 support */ |
150 | static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = { | 150 | static const int ab8540_irq_regoffset[AB8540_NUM_IRQ_REGS] = { |
151 | 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, 23, | 151 | 0, 1, 2, 3, 4, -1, -1, -1, -1, 11, 18, 19, 20, 21, 12, 13, 24, 5, 22, |
152 | 25, 26, 27, 28, 29, 30, 31, | 152 | 23, 25, 26, 27, 28, 29, 30, 31, |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static const char ab8500_version_str[][7] = { | 155 | static const char ab8500_version_str[][7] = { |
@@ -322,7 +322,7 @@ static int ab8500_mask_and_set_register(struct device *dev, | |||
322 | struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); | 322 | struct ab8500 *ab8500 = dev_get_drvdata(dev->parent); |
323 | 323 | ||
324 | atomic_inc(&ab8500->transfer_ongoing); | 324 | atomic_inc(&ab8500->transfer_ongoing); |
325 | ret= mask_and_set_register_interruptible(ab8500, bank, reg, | 325 | ret = mask_and_set_register_interruptible(ab8500, bank, reg, |
326 | bitmask, bitvalues); | 326 | bitmask, bitvalues); |
327 | atomic_dec(&ab8500->transfer_ongoing); | 327 | atomic_dec(&ab8500->transfer_ongoing); |
328 | return ret; | 328 | return ret; |
@@ -415,9 +415,11 @@ static void ab8500_irq_unmask(struct irq_data *data) | |||
415 | if (type & IRQ_TYPE_EDGE_FALLING) { | 415 | if (type & IRQ_TYPE_EDGE_FALLING) { |
416 | if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R) | 416 | if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R) |
417 | ab8500->mask[index + 2] &= ~mask; | 417 | ab8500->mask[index + 2] &= ~mask; |
418 | else if (offset >= AB9540_INT_GPIO50R && offset <= AB9540_INT_GPIO54R) | 418 | else if (offset >= AB9540_INT_GPIO50R && |
419 | offset <= AB9540_INT_GPIO54R) | ||
419 | ab8500->mask[index + 1] &= ~mask; | 420 | ab8500->mask[index + 1] &= ~mask; |
420 | else if (offset == AB8540_INT_GPIO43R || offset == AB8540_INT_GPIO44R) | 421 | else if (offset == AB8540_INT_GPIO43R || |
422 | offset == AB8540_INT_GPIO44R) | ||
421 | /* Here the falling IRQ is one bit lower */ | 423 | /* Here the falling IRQ is one bit lower */ |
422 | ab8500->mask[index] &= ~(mask << 1); | 424 | ab8500->mask[index] &= ~(mask << 1); |
423 | else | 425 | else |
@@ -451,7 +453,7 @@ static void update_latch_offset(u8 *offset, int i) | |||
451 | /* Fix inconsistent ab8540 bit mapping... */ | 453 | /* Fix inconsistent ab8540 bit mapping... */ |
452 | if (unlikely(*offset == 16)) | 454 | if (unlikely(*offset == 16)) |
453 | *offset = 25; | 455 | *offset = 25; |
454 | if ((i==3) && (*offset >= 24)) | 456 | if ((i == 3) && (*offset >= 24)) |
455 | *offset += 2; | 457 | *offset += 2; |
456 | } | 458 | } |
457 | 459 | ||
@@ -573,8 +575,8 @@ static int ab8500_irq_map(struct irq_domain *d, unsigned int virq, | |||
573 | } | 575 | } |
574 | 576 | ||
575 | static struct irq_domain_ops ab8500_irq_ops = { | 577 | static struct irq_domain_ops ab8500_irq_ops = { |
576 | .map = ab8500_irq_map, | 578 | .map = ab8500_irq_map, |
577 | .xlate = irq_domain_xlate_twocell, | 579 | .xlate = irq_domain_xlate_twocell, |
578 | }; | 580 | }; |
579 | 581 | ||
580 | static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) | 582 | static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) |
@@ -1551,7 +1553,7 @@ static struct attribute_group ab9540_attr_group = { | |||
1551 | 1553 | ||
1552 | static int ab8500_probe(struct platform_device *pdev) | 1554 | static int ab8500_probe(struct platform_device *pdev) |
1553 | { | 1555 | { |
1554 | static char *switch_off_status[] = { | 1556 | static const char *switch_off_status[] = { |
1555 | "Swoff bit programming", | 1557 | "Swoff bit programming", |
1556 | "Thermal protection activation", | 1558 | "Thermal protection activation", |
1557 | "Vbat lower then BattOk falling threshold", | 1559 | "Vbat lower then BattOk falling threshold", |
@@ -1560,7 +1562,7 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1560 | "Battery level lower than power on reset threshold", | 1562 | "Battery level lower than power on reset threshold", |
1561 | "Power on key 1 pressed longer than 10 seconds", | 1563 | "Power on key 1 pressed longer than 10 seconds", |
1562 | "DB8500 thermal shutdown"}; | 1564 | "DB8500 thermal shutdown"}; |
1563 | static char *turn_on_status[] = { | 1565 | static const char *turn_on_status[] = { |
1564 | "Battery rising (Vbat)", | 1566 | "Battery rising (Vbat)", |
1565 | "Power On Key 1 dbF", | 1567 | "Power On Key 1 dbF", |
1566 | "Power On Key 2 dbF", | 1568 | "Power On Key 2 dbF", |
@@ -1579,7 +1581,7 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1579 | int i; | 1581 | int i; |
1580 | u8 value; | 1582 | u8 value; |
1581 | 1583 | ||
1582 | ab8500 = devm_kzalloc(&pdev->dev, sizeof *ab8500, GFP_KERNEL); | 1584 | ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL); |
1583 | if (!ab8500) | 1585 | if (!ab8500) |
1584 | return -ENOMEM; | 1586 | return -ENOMEM; |
1585 | 1587 | ||
@@ -1636,7 +1638,7 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1636 | ab8500->mask_size = AB8540_NUM_IRQ_REGS; | 1638 | ab8500->mask_size = AB8540_NUM_IRQ_REGS; |
1637 | ab8500->irq_reg_offset = ab8540_irq_regoffset; | 1639 | ab8500->irq_reg_offset = ab8540_irq_regoffset; |
1638 | ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM; | 1640 | ab8500->it_latchhier_num = AB8540_IT_LATCHHIER_NUM; |
1639 | }/* Configure AB8500 or AB9540 IRQ */ | 1641 | } /* Configure AB8500 or AB9540 IRQ */ |
1640 | else if (is_ab9540(ab8500) || is_ab8505(ab8500)) { | 1642 | else if (is_ab9540(ab8500) || is_ab8505(ab8500)) { |
1641 | ab8500->mask_size = AB9540_NUM_IRQ_REGS; | 1643 | ab8500->mask_size = AB9540_NUM_IRQ_REGS; |
1642 | ab8500->irq_reg_offset = ab9540_irq_regoffset; | 1644 | ab8500->irq_reg_offset = ab9540_irq_regoffset; |
@@ -1646,10 +1648,12 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1646 | ab8500->irq_reg_offset = ab8500_irq_regoffset; | 1648 | ab8500->irq_reg_offset = ab8500_irq_regoffset; |
1647 | ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM; | 1649 | ab8500->it_latchhier_num = AB8500_IT_LATCHHIER_NUM; |
1648 | } | 1650 | } |
1649 | ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL); | 1651 | ab8500->mask = devm_kzalloc(&pdev->dev, ab8500->mask_size, |
1652 | GFP_KERNEL); | ||
1650 | if (!ab8500->mask) | 1653 | if (!ab8500->mask) |
1651 | return -ENOMEM; | 1654 | return -ENOMEM; |
1652 | ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, GFP_KERNEL); | 1655 | ab8500->oldmask = devm_kzalloc(&pdev->dev, ab8500->mask_size, |
1656 | GFP_KERNEL); | ||
1653 | if (!ab8500->oldmask) | 1657 | if (!ab8500->oldmask) |
1654 | return -ENOMEM; | 1658 | return -ENOMEM; |
1655 | 1659 | ||
@@ -1674,14 +1678,13 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1674 | if (value) { | 1678 | if (value) { |
1675 | for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) { | 1679 | for (i = 0; i < ARRAY_SIZE(switch_off_status); i++) { |
1676 | if (value & 1) | 1680 | if (value & 1) |
1677 | printk(KERN_CONT " \"%s\"", | 1681 | pr_cont(" \"%s\"", switch_off_status[i]); |
1678 | switch_off_status[i]); | ||
1679 | value = value >> 1; | 1682 | value = value >> 1; |
1680 | 1683 | ||
1681 | } | 1684 | } |
1682 | printk(KERN_CONT "\n"); | 1685 | pr_cont("\n"); |
1683 | } else { | 1686 | } else { |
1684 | printk(KERN_CONT " None\n"); | 1687 | pr_cont(" None\n"); |
1685 | } | 1688 | } |
1686 | ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, | 1689 | ret = get_register_interruptible(ab8500, AB8500_SYS_CTRL1_BLOCK, |
1687 | AB8500_TURN_ON_STATUS, &value); | 1690 | AB8500_TURN_ON_STATUS, &value); |
@@ -1692,12 +1695,12 @@ static int ab8500_probe(struct platform_device *pdev) | |||
1692 | if (value) { | 1695 | if (value) { |
1693 | for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) { | 1696 | for (i = 0; i < ARRAY_SIZE(turn_on_status); i++) { |
1694 | if (value & 1) | 1697 | if (value & 1) |
1695 | printk("\"%s\" ", turn_on_status[i]); | 1698 | pr_cont("\"%s\" ", turn_on_status[i]); |
1696 | value = value >> 1; | 1699 | value = value >> 1; |
1697 | } | 1700 | } |
1698 | printk("\n"); | 1701 | pr_cont("\n"); |
1699 | } else { | 1702 | } else { |
1700 | printk("None\n"); | 1703 | pr_cont("None\n"); |
1701 | } | 1704 | } |
1702 | 1705 | ||
1703 | if (plat && plat->init) | 1706 | if (plat && plat->init) |