mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-17 05:49:31 +07:00
greybus: power_supply: fix check for configured supply
The correct check for if the power supply is ready to receive event is wrong and it should check for the registered flag. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reported-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
e527338104
commit
adb57cff54
@ -697,7 +697,8 @@ static int gb_power_supply_event_recv(u8 type, struct gb_operation *op)
|
||||
payload = request->payload;
|
||||
psy_id = payload->psy_id;
|
||||
mutex_lock(&supplies->supplies_lock);
|
||||
if (psy_id >= supplies->supplies_count || !&supplies->supply[psy_id]) {
|
||||
if (psy_id >= supplies->supplies_count ||
|
||||
!supplies->supply[psy_id].registered) {
|
||||
dev_err(&connection->bundle->dev,
|
||||
"Event received for unconfigured power_supply id: %d\n",
|
||||
psy_id);
|
||||
|
Loading…
Reference in New Issue
Block a user