greybus: power_supply: fix unregister on error path
authorRui Miguel Silva <rui.silva@linaro.org>
Fri, 8 Jan 2016 13:53:43 +0000 (13:53 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 12 Jan 2016 03:18:14 +0000 (19:18 -0800)
commitff85f723ca362986dc984217433cbdd133fc03d6
tree4e15c5bdb20ae4c5974e03ce38991916be0f2d13
parent7ccac20d59ca45a2efea93a24a99d57022ff8911
greybus: power_supply: fix unregister on error path

If setup fail the release for each supply needs to know the status at
unregister time. So, add the field to the structure, update it at setup
time and use it at release.

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>
drivers/staging/greybus/power_supply.c