staging: omap-thermal: improve conf data handling and initialization
authorEduardo Valentin <eduardo.valentin@ti.com>
Tue, 11 Sep 2012 16:06:55 +0000 (19:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Sep 2012 19:14:16 +0000 (12:14 -0700)
commit04a4d10d07b1017eadef721fcd5a3937e2e1be53
treebc172284f7f14f364fd5072b7553eeaa5a496e2e
parent765a1939a364d121e70b452c3df34c2af446f47a
staging: omap-thermal: improve conf data handling and initialization

While registering the thermal zone, it is required to have the cooling
devices already setup, so that the .bind callback can succeed.

Due to that, the driver code needs to be reorganized so that we first
setup the cooling devices then the zones. This way we cope with the
right thermal framework initialization sequence.

This patch changes the order of the thermal zone initialization,
so that we create it only when the cooling devices are available.
It also adds some defensive checks for the config data, so that
the callbacks are ready for calls when the data is still not
initialized.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/omap-thermal/omap-bandgap.c
drivers/staging/omap-thermal/omap-thermal-common.c