mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
extcon: max8997: Fix incorrect error check and return value
irq_create_mapping() returns 0 if it fails to provide a valid irq number. 'ret' needs to be updated with a negative error code before returning from probe to signal probe failure. While at it, also corrected the 'virq' type to unsigned from signed. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]> Signed-off-by: Myungjoo Ham <[email protected]>
This commit is contained in:
parent
c0c078c363
commit
68c9274d0f
1 changed files with 4 additions and 2 deletions
|
|
@ -450,11 +450,13 @@ static int __devinit max8997_muic_probe(struct platform_device *pdev)
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(muic_irqs); i++) {
|
||||
struct max8997_muic_irq *muic_irq = &muic_irqs[i];
|
||||
int virq = 0;
|
||||
unsigned int virq = 0;
|
||||
|
||||
virq = irq_create_mapping(max8997->irq_domain, muic_irq->irq);
|
||||
if (!virq)
|
||||
if (!virq) {
|
||||
ret = -EINVAL;
|
||||
goto err_irq;
|
||||
}
|
||||
muic_irq->virq = virq;
|
||||
|
||||
ret = request_threaded_irq(virq, NULL,max8997_muic_irq_handler,
|
||||
|
|
|
|||
Loading…
Reference in a new issue