@@ -148,8 +148,8 @@ static const int ab9540_irq_regoffset[AB9540_NUM_IRQ_REGS] = {
148
148
149
149
/* AB8540 support */
150
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 ,
152
- 25 , 26 , 27 , 28 , 29 , 30 , 31 ,
151
+ 0 , 1 , 2 , 3 , 4 , -1 , -1 , -1 , -1 , 11 , 18 , 19 , 20 , 21 , 12 , 13 , 24 , 5 , 22 ,
152
+ 23 , 25 , 26 , 27 , 28 , 29 , 30 , 31 ,
153
153
};
154
154
155
155
static const char ab8500_version_str [][7 ] = {
@@ -322,7 +322,7 @@ static int ab8500_mask_and_set_register(struct device *dev,
322
322
struct ab8500 * ab8500 = dev_get_drvdata (dev -> parent );
323
323
324
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
326
bitmask , bitvalues );
327
327
atomic_dec (& ab8500 -> transfer_ongoing );
328
328
return ret ;
@@ -415,9 +415,11 @@ static void ab8500_irq_unmask(struct irq_data *data)
415
415
if (type & IRQ_TYPE_EDGE_FALLING ) {
416
416
if (offset >= AB8500_INT_GPIO6R && offset <= AB8500_INT_GPIO41R )
417
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
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
423
/* Here the falling IRQ is one bit lower */
422
424
ab8500 -> mask [index ] &= ~(mask << 1 );
423
425
else
@@ -451,7 +453,7 @@ static void update_latch_offset(u8 *offset, int i)
451
453
/* Fix inconsistent ab8540 bit mapping... */
452
454
if (unlikely (* offset == 16 ))
453
455
* offset = 25 ;
454
- if ((i == 3 ) && (* offset >= 24 ))
456
+ if ((i == 3 ) && (* offset >= 24 ))
455
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
577
static struct irq_domain_ops ab8500_irq_ops = {
576
- .map = ab8500_irq_map ,
577
- .xlate = irq_domain_xlate_twocell ,
578
+ .map = ab8500_irq_map ,
579
+ .xlate = irq_domain_xlate_twocell ,
578
580
};
579
581
580
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
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
1557
"Swoff bit programming" ,
1556
1558
"Thermal protection activation" ,
1557
1559
"Vbat lower then BattOk falling threshold" ,
@@ -1560,7 +1562,7 @@ static int ab8500_probe(struct platform_device *pdev)
1560
1562
"Battery level lower than power on reset threshold" ,
1561
1563
"Power on key 1 pressed longer than 10 seconds" ,
1562
1564
"DB8500 thermal shutdown" };
1563
- static char * turn_on_status [] = {
1565
+ static const char * turn_on_status [] = {
1564
1566
"Battery rising (Vbat)" ,
1565
1567
"Power On Key 1 dbF" ,
1566
1568
"Power On Key 2 dbF" ,
@@ -1579,7 +1581,7 @@ static int ab8500_probe(struct platform_device *pdev)
1579
1581
int i ;
1580
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
1585
if (!ab8500 )
1584
1586
return - ENOMEM ;
1585
1587
@@ -1636,7 +1638,7 @@ static int ab8500_probe(struct platform_device *pdev)
1636
1638
ab8500 -> mask_size = AB8540_NUM_IRQ_REGS ;
1637
1639
ab8500 -> irq_reg_offset = ab8540_irq_regoffset ;
1638
1640
ab8500 -> it_latchhier_num = AB8540_IT_LATCHHIER_NUM ;
1639
- }/* Configure AB8500 or AB9540 IRQ */
1641
+ } /* Configure AB8500 or AB9540 IRQ */
1640
1642
else if (is_ab9540 (ab8500 ) || is_ab8505 (ab8500 )) {
1641
1643
ab8500 -> mask_size = AB9540_NUM_IRQ_REGS ;
1642
1644
ab8500 -> irq_reg_offset = ab9540_irq_regoffset ;
@@ -1646,10 +1648,12 @@ static int ab8500_probe(struct platform_device *pdev)
1646
1648
ab8500 -> irq_reg_offset = ab8500_irq_regoffset ;
1647
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
1653
if (!ab8500 -> mask )
1651
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
1657
if (!ab8500 -> oldmask )
1654
1658
return - ENOMEM ;
1655
1659
@@ -1674,14 +1678,13 @@ static int ab8500_probe(struct platform_device *pdev)
1674
1678
if (value ) {
1675
1679
for (i = 0 ; i < ARRAY_SIZE (switch_off_status ); i ++ ) {
1676
1680
if (value & 1 )
1677
- printk (KERN_CONT " \"%s\"" ,
1678
- switch_off_status [i ]);
1681
+ pr_cont (" \"%s\"" , switch_off_status [i ]);
1679
1682
value = value >> 1 ;
1680
1683
1681
1684
}
1682
- printk ( KERN_CONT "\n" );
1685
+ pr_cont ( "\n" );
1683
1686
} else {
1684
- printk ( KERN_CONT " None\n" );
1687
+ pr_cont ( " None\n" );
1685
1688
}
1686
1689
ret = get_register_interruptible (ab8500 , AB8500_SYS_CTRL1_BLOCK ,
1687
1690
AB8500_TURN_ON_STATUS , & value );
@@ -1692,12 +1695,12 @@ static int ab8500_probe(struct platform_device *pdev)
1692
1695
if (value ) {
1693
1696
for (i = 0 ; i < ARRAY_SIZE (turn_on_status ); i ++ ) {
1694
1697
if (value & 1 )
1695
- printk ("\"%s\" " , turn_on_status [i ]);
1698
+ pr_cont ("\"%s\" " , turn_on_status [i ]);
1696
1699
value = value >> 1 ;
1697
1700
}
1698
- printk ("\n" );
1701
+ pr_cont ("\n" );
1699
1702
} else {
1700
- printk ("None\n" );
1703
+ pr_cont ("None\n" );
1701
1704
}
1702
1705
1703
1706
if (plat && plat -> init )
0 commit comments