/* Return the battery temperature in Celsius degrees Or < 0 if something fails.  */
static int bq27x00_battery_temperature(struct bq27x00_device_info *di)
/* Return the battery temperature in Celsius degrees Or < 0 if something fails.  */
static int bq27x00_battery_temperature(struct bq27x00_device_info *di)
{
	int ret;
	int temp = 0;
	ret = bq27x00_read(BQ27x00_REG_TEMP, &temp, 0, di);
	if (ret) {
		dev_err(di->dev, "error reading temperature\n");
		return ret;
	}
	return (temp >> 2) - 273;
}