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

Commit 3f3217de authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Kishor Krishna Bhat
Browse files

UPSTREAM: HID: playstation: Fix unused variable in ps_battery_get_property



The ret variable in ps_battery_get_property is set in an error path,
but never actually returned. Change this function to return ret.

Bug: 167947264
CRs-fixed: 2971837
Change-Id: Ieeaff4d249a6ee6d02eb4746f9fe502c91c6f40a
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarRoderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarFarid Chahla <farid.chahla@sony.com>
Signed-off-by: default avatarSiarhei Vishniakou <svv@google.com>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git


Git-commit: 5fb52551248f54ddc8f72bc252661468b603cfcc
Signed-off-by: default avatarKishor Krishna Bhat <kishkris@codeaurora.org>
parent 7c1277fc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ static int ps_battery_get_property(struct power_supply *psy,
	uint8_t battery_capacity;
	int battery_status;
	unsigned long flags;
	int ret;
	int ret = 0;

	spin_lock_irqsave(&dev->lock, flags);
	battery_capacity = dev->battery_capacity;
@@ -364,7 +364,7 @@ static int ps_battery_get_property(struct power_supply *psy,
		break;
	}

	return 0;
	return ret;
}

static int ps_device_register_battery(struct ps_device *dev)