]> git.karo-electronics.de Git - linux-beck.git/commitdiff
max17042_battery: Handle irq request failure case
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>
Fri, 4 May 2012 23:13:10 +0000 (04:43 +0530)
committerAnton Vorontsov <anton.vorontsov@linaro.org>
Sat, 5 May 2012 10:31:04 +0000 (03:31 -0700)
suspend/resume functions take action based upon the fuel gauge
interrupt. If the rquest irq fails we should assign 0 to client->irq.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
drivers/power/max17042_battery.c

index b4c8af016278f5fb7a29d2af95d086f722e673f7..8d28006322e94227b7ccfa249bf7ff2e8d59798b 100644 (file)
@@ -706,9 +706,11 @@ static int __devinit max17042_probe(struct i2c_client *client,
                        reg |= CONFIG_ALRT_BIT_ENBL;
                        max17042_write_reg(client, MAX17042_CONFIG, reg);
                        max17042_set_soc_threshold(chip, 1);
-               } else
+               } else {
+                       client->irq = 0;
                        dev_err(&client->dev, "%s(): cannot get IRQ\n",
                                __func__);
+               }
        }
 
        reg = max17042_read_reg(chip->client, MAX17042_STATUS);