max17042_battery: Divide by 0 crash because r_sns init too late
authorPhilip Rakity <prakity@marvell.com>
Sat, 13 Aug 2011 04:18:18 +0000 (21:18 -0700)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Fri, 19 Aug 2011 17:03:27 +0000 (21:03 +0400)
commit4cfa892c03b35f3c61d93e0d8d97ff8db074818f
tree81cc2a49230854abe1f7de1d78ce9ab1bb57bdb8
parent45d116ec2503c4255374e11c2c48f81cdf6d0f1d
max17042_battery: Divide by 0 crash because r_sns init too late

On MMP2 brownstone divide by 0 error since probe sets r_sns
after calling power_supply_register.

Move the code up a few lines.  r_sns comes from the platform
data.

PROP_CURRENT_AVG and PROP_CURRENT divide the result by r_sns.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
drivers/power/max17042_battery.c