From e5ba50bc3b9311256ae6a6620e7708fb25d1f6e2 Mon Sep 17 00:00:00 2001 From: Ramakrishna Pallala Date: Sat, 5 May 2012 04:43:10 +0530 Subject: 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 Signed-off-by: Anton Vorontsov --- drivers/power/max17042_battery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/power/max17042_battery.c') 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, 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); -- cgit v1.2.3