misc: pmic8058-xoadc: Fix section mismatches

The remove function is called from the probe function for any
error that occurs. Beyond just triggering a section mismatch this
also leads to incorrect operations occurring on error and a memory
leak as well. Fix all of this with devm_kzalloc and proper
ordering of the probe routine. We do hit a point of no return in
the probe, but that's existed for a long time so this isn't any
worse.

WARNING: vmlinux.o(.devinit.text+0x12d0): Section mismatch in
reference from the function pm8058_xoadc_probe() to the function
.devexit.text:pm8058_xoadc_teardown()
The function __devinit pm8058_xoadc_probe() references
a function __devexit pm8058_xoadc_teardown().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
pm8058_xoadc_teardown() so it may be used outside an exit
section.

Change-Id: I416b58ec12e3474149fb3fad49969cd162275633
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
1 file changed