diff options
author | Jonghwan Choi <jhbird.choi@samsung.com> | 2012-02-20 10:22:56 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-06 12:46:35 -0500 |
commit | c7a1fcf3b1660dbccdc2faf9e506e0264b17c4ce (patch) | |
tree | 4b5c0425c471b01ca881e62e19df1b7a9fc54736 /drivers/mfd/s5m-irq.c | |
parent | c3ebb30aaeb2a30d69b9db564d93bf3486139c12 (diff) |
mfd: Fix s5m error handling for invalid device type
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>
Diffstat (limited to 'drivers/mfd/s5m-irq.c')
-rw-r--r-- | drivers/mfd/s5m-irq.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mfd/s5m-irq.c b/drivers/mfd/s5m-irq.c index de76dfb6f0ad..0236676085cf 100644 --- a/drivers/mfd/s5m-irq.c +++ b/drivers/mfd/s5m-irq.c | |||
@@ -342,7 +342,10 @@ int s5m_irq_resume(struct s5m87xx_dev *s5m87xx) | |||
342 | s5m8767_irq_thread(s5m87xx->irq_base, s5m87xx); | 342 | s5m8767_irq_thread(s5m87xx->irq_base, s5m87xx); |
343 | break; | 343 | break; |
344 | default: | 344 | default: |
345 | break; | 345 | dev_err(s5m87xx->dev, |
346 | "Unknown device type %d\n", | ||
347 | s5m87xx->device_type); | ||
348 | return -EINVAL; | ||
346 | 349 | ||
347 | } | 350 | } |
348 | } | 351 | } |
@@ -444,7 +447,9 @@ int s5m_irq_init(struct s5m87xx_dev *s5m87xx) | |||
444 | } | 447 | } |
445 | break; | 448 | break; |
446 | default: | 449 | default: |
447 | break; | 450 | dev_err(s5m87xx->dev, |
451 | "Unknown device type %d\n", s5m87xx->device_type); | ||
452 | return -EINVAL; | ||
448 | } | 453 | } |
449 | 454 | ||
450 | if (!s5m87xx->ono) | 455 | if (!s5m87xx->ono) |
@@ -467,12 +472,15 @@ int s5m_irq_init(struct s5m87xx_dev *s5m87xx) | |||
467 | IRQF_ONESHOT, "s5m87xx-ono", s5m87xx); | 472 | IRQF_ONESHOT, "s5m87xx-ono", s5m87xx); |
468 | break; | 473 | break; |
469 | default: | 474 | default: |
475 | ret = -EINVAL; | ||
470 | break; | 476 | break; |
471 | } | 477 | } |
472 | 478 | ||
473 | if (ret) | 479 | if (ret) { |
474 | dev_err(s5m87xx->dev, "Failed to request IRQ %d: %d\n", | 480 | dev_err(s5m87xx->dev, "Failed to request IRQ %d: %d\n", |
475 | s5m87xx->ono, ret); | 481 | s5m87xx->ono, ret); |
482 | return ret; | ||
483 | } | ||
476 | 484 | ||
477 | return 0; | 485 | return 0; |
478 | } | 486 | } |