Skip to content

Commit

Permalink
mfd: palmas: Check if irq is valid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
J Keerthy authored and Samuel Ortiz committed Jun 20, 2013
1 parent 283aae8 commit ad522f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/mfd/palmas.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
}
}

if (!palmas->irq) {
dev_warn(palmas->dev, "IRQ missing: skipping irq request\n");
goto no_irq;
}

/* Change interrupt line output polarity */
if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH)
reg = PALMAS_POLARITY_CTRL_INT_POLARITY;
Expand All @@ -316,6 +321,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c,
if (ret < 0)
goto err;

no_irq:
slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE);
addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE,
PALMAS_PRIMARY_SECONDARY_PAD1);
Expand Down

0 comments on commit ad522f4

Please sign in to comment.