aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/max17042_battery.c
diff options
context:
space:
mode:
authorRamakrishna Pallala <ramakrishna.pallala@intel.com>2012-05-04 19:13:10 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-05 06:31:04 -0400
commite5ba50bc3b9311256ae6a6620e7708fb25d1f6e2 (patch)
treec2e332db07011193fe61ea390ee48a4df9b1839f /drivers/power/max17042_battery.c
parent243e3527ffbda96434429e618324f80ca0d98902 (diff)
max17042_battery: Handle irq request failure case
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>
Diffstat (limited to 'drivers/power/max17042_battery.c')
-rw-r--r--drivers/power/max17042_battery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index b4c8af016278..8d28006322e9 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -706,9 +706,11 @@ static int __devinit max17042_probe(struct i2c_client *client,
706 reg |= CONFIG_ALRT_BIT_ENBL; 706 reg |= CONFIG_ALRT_BIT_ENBL;
707 max17042_write_reg(client, MAX17042_CONFIG, reg); 707 max17042_write_reg(client, MAX17042_CONFIG, reg);
708 max17042_set_soc_threshold(chip, 1); 708 max17042_set_soc_threshold(chip, 1);
709 } else 709 } else {
710 client->irq = 0;
710 dev_err(&client->dev, "%s(): cannot get IRQ\n", 711 dev_err(&client->dev, "%s(): cannot get IRQ\n",
711 __func__); 712 __func__);
713 }
712 } 714 }
713 715
714 reg = max17042_read_reg(chip->client, MAX17042_STATUS); 716 reg = max17042_read_reg(chip->client, MAX17042_STATUS);