diff options
author | J Keerthy <j-keerthy@ti.com> | 2013-06-19 01:57:47 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-20 04:50:55 -0400 |
commit | ad522f4e351d020714959d9570baf3de7fcbad11 (patch) | |
tree | f90bbb8947915f8d0db372f9ae687e2eb8862255 /drivers/mfd/palmas.c | |
parent | 283aae8ab88e695a660c610d6535ca44bc5b8835 (diff) |
mfd: palmas: Check if irq is valid
Check if irq value obtained is valid. If it is not valid
then skip the irq request step and go ahead with the probe.
Signed-off-by: J Keerthy <j-keerthy@ti.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/palmas.c')
-rw-r--r-- | drivers/mfd/palmas.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 62fa728d3e04..b24bee3d00b4 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c | |||
@@ -290,6 +290,11 @@ static int palmas_i2c_probe(struct i2c_client *i2c, | |||
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | if (!palmas->irq) { | ||
294 | dev_warn(palmas->dev, "IRQ missing: skipping irq request\n"); | ||
295 | goto no_irq; | ||
296 | } | ||
297 | |||
293 | /* Change interrupt line output polarity */ | 298 | /* Change interrupt line output polarity */ |
294 | if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH) | 299 | if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH) |
295 | reg = PALMAS_POLARITY_CTRL_INT_POLARITY; | 300 | reg = PALMAS_POLARITY_CTRL_INT_POLARITY; |
@@ -316,6 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, | |||
316 | if (ret < 0) | 321 | if (ret < 0) |
317 | goto err; | 322 | goto err; |
318 | 323 | ||
324 | no_irq: | ||
319 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); | 325 | slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); |
320 | addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE, | 326 | addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE, |
321 | PALMAS_PRIMARY_SECONDARY_PAD1); | 327 | PALMAS_PRIMARY_SECONDARY_PAD1); |