summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorRoderick Colenbrander <roderick.colenbrander@sony.com>2021-02-11 22:41:00 -0800
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2021-02-17 18:34:55 +0100
commit5fb52551248f54ddc8f72bc252661468b603cfcc (patch)
tree7ad0a3f47e6ab2ab786cf7a27cee29f1ad8c7c07 /drivers/hid
parent0b25b55d34f554b43a679e7e1303beb973b63e27 (diff)
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 the function to return ret. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-playstation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index 84f484fce1ee..f279064e74a5 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -333,7 +333,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;
@@ -358,7 +358,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)