* [PATCH] mfd: s5m: fix error handling for invalid device type
@ 2012-01-16 6:52 jhbird.choi
2012-02-20 15:24 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: jhbird.choi @ 2012-01-16 6:52 UTC (permalink / raw)
To: linux-kernel; +Cc: Samuel Ortiz, Sangbeom Kim, Mark Brown, Jonghwan Choi
From: Jonghwan Choi <jhbird.choi@samsung.com>
If device type is not supported in driver, have to retun error.
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
drivers/mfd/s5m-irq.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/s5m-irq.c b/drivers/mfd/s5m-irq.c
index de76dfb..2aa7708 100644
--- a/drivers/mfd/s5m-irq.c
+++ b/drivers/mfd/s5m-irq.c
@@ -342,7 +342,8 @@ 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;
}
}
@@ -444,7 +445,8 @@ 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)
@@ -467,12 +469,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;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: s5m: fix error handling for invalid device type
2012-01-16 6:52 [PATCH] mfd: s5m: fix error handling for invalid device type jhbird.choi
@ 2012-02-20 15:24 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-02-20 15:24 UTC (permalink / raw)
To: jhbird.choi; +Cc: linux-kernel, Sangbeom Kim, Mark Brown
Hi Jonghwan,
On Mon, Jan 16, 2012 at 03:52:21PM +0900, jhbird.choi@samsung.com wrote:
> From: Jonghwan Choi <jhbird.choi@samsung.com>
>
> If device type is not supported in driver, have to retun error.
I applied this one, after fixing the > 80 chars issues.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-20 15:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16 6:52 [PATCH] mfd: s5m: fix error handling for invalid device type jhbird.choi
2012-02-20 15:24 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).