Commit adb57cff authored by Rui Miguel Silva's avatar Rui Miguel Silva Committed by Greg Kroah-Hartman

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: default avatarRui Miguel Silva <rui.silva@linaro.org>
Reported-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent e5273381
......@@ -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);
......
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