mfd: palmas: Check if irq is valid
authorJ Keerthy <j-keerthy@ti.com>
Wed, 19 Jun 2013 05:57:47 +0000 (11:27 +0530)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 20 Jun 2013 08:50:55 +0000 (10:50 +0200)
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>
drivers/mfd/palmas.c

index 62fa728..b24bee3 100644 (file)
@@ -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;
@@ -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);