Skip to content

Commit

Permalink
max17042_battery: Handle irq request failure case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramakrishna Pallala authored and Anton Vorontsov committed May 5, 2012
1 parent 243e352 commit e5ba50b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/power/max17042_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e5ba50b

Please sign in to comment.