Skip to content

Commit

Permalink
mfd: Fix s5m error handling for invalid device type
Browse files Browse the repository at this point in the history
If device type is not supported in driver, have to retun error.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Jonghwan Choi authored and Samuel Ortiz committed Mar 6, 2012
1 parent c3ebb30 commit c7a1fcf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/mfd/s5m-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ int s5m_irq_resume(struct s5m87xx_dev *s5m87xx)
s5m8767_irq_thread(s5m87xx->irq_base, s5m87xx);
break;
default:
break;
dev_err(s5m87xx->dev,
"Unknown device type %d\n",
s5m87xx->device_type);
return -EINVAL;

}
}
Expand Down Expand Up @@ -444,7 +447,9 @@ int s5m_irq_init(struct s5m87xx_dev *s5m87xx)
}
break;
default:
break;
dev_err(s5m87xx->dev,
"Unknown device type %d\n", s5m87xx->device_type);
return -EINVAL;
}

if (!s5m87xx->ono)
Expand All @@ -467,12 +472,15 @@ int s5m_irq_init(struct s5m87xx_dev *s5m87xx)
IRQF_ONESHOT, "s5m87xx-ono", s5m87xx);
break;
default:
ret = -EINVAL;
break;
}

if (ret)
if (ret) {
dev_err(s5m87xx->dev, "Failed to request IRQ %d: %d\n",
s5m87xx->ono, ret);
return ret;
}

return 0;
}
Expand Down

0 comments on commit c7a1fcf

Please sign in to comment.