/* Return the battery Relative State-of-Charge Or < 0 if something fails.  */
static int bq27x00_battery_rsoc(struct bq27x00_device_info *di)
/* Return the battery Relative State-of-Charge Or < 0 if something fails.  */
static int bq27x00_battery_rsoc(struct bq27x00_device_info *di)
{
	int ret;
	int rsoc = 0;
	ret = bq27x00_read(BQ27x00_REG_RSOC, &rsoc, 1, di);
	if (ret) {
		dev_err(di->dev, "error reading relative State-of-Charge\n");
		return ret;
	}
	return rsoc >> 8;
}