Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5ba50bc authored by Ramakrishna Pallala's avatar Ramakrishna Pallala Committed by Anton Vorontsov
Browse files

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: default avatarRamakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
parent 243e3527
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -706,10 +706,12 @@ 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);
	if (reg & STATUS_POR_BIT) {