From: Rui Miguel Silva Date: Tue, 16 Aug 2016 21:31:56 +0000 (+0100) Subject: greybus: power_supply: fix update interval check at request handler X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5f66d62e8372d8a9c97bd75d772a5a5788925218;p=linux-beck.git greybus: power_supply: fix update interval check at request handler We use the update interval to control the remove path and we set it to zero when we do not want to have more updates in transit. That means that the check in the request handler needs to be for interval update zero to discard the newly received request and not the other way around like it is. This will fix the issue that all incoming requests were being discard. Signed-off-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index aeb6a07e43a6..3d6f81017d98 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -982,7 +982,7 @@ static int gb_supplies_request_handler(struct gb_operation *op) * running. For that just check update_interval. */ gbpsy = &supplies->supply[psy_id]; - if (gbpsy->update_interval) { + if (!gbpsy->update_interval) { ret = -ESHUTDOWN; goto out_unlock; }