greybus: power_supply: Break supply setup into two parts
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 12 Feb 2016 10:38:32 +0000 (16:08 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Feb 2016 22:53:43 +0000 (14:53 -0800)
commit7e9fba8df7606bcace9d22394f59c2047dd55091
treecd2bdd34584ce037c17b07183455df9dec6cc0e2
parent69564dfeacf0728b60e3b2c85b357bc63213116c
greybus: power_supply: Break supply setup into two parts

This breaks the power supply setup routine into two parts, the first one
allocates all the necessary resources and the second on registers
supplies to the required frameworks.

This is required to enable only TX on the connection, until we have
allocated all the resources, otherwise the request handler might get
called for partially initialized structures.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/power_supply.c