Commit 5fb52551 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Benjamin Tissoires

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: 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>
parent 0b25b55d
...@@ -333,7 +333,7 @@ static int ps_battery_get_property(struct power_supply *psy, ...@@ -333,7 +333,7 @@ static int ps_battery_get_property(struct power_supply *psy,
uint8_t battery_capacity; uint8_t battery_capacity;
int battery_status; int battery_status;
unsigned long flags; unsigned long flags;
int ret; int ret = 0;
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
battery_capacity = dev->battery_capacity; battery_capacity = dev->battery_capacity;
...@@ -358,7 +358,7 @@ static int ps_battery_get_property(struct power_supply *psy, ...@@ -358,7 +358,7 @@ static int ps_battery_get_property(struct power_supply *psy,
break; break;
} }
return 0; return ret;
} }
static int ps_device_register_battery(struct ps_device *dev) static int ps_device_register_battery(struct ps_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment