diff options
Diffstat (limited to 'drivers/power/rx51_battery.c')
-rw-r--r-- | drivers/power/rx51_battery.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c index 35f625e18ba..cbde1d6d322 100644 --- a/drivers/power/rx51_battery.c +++ b/drivers/power/rx51_battery.c @@ -120,7 +120,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di) /* First check for temperature in first direct table */ if (raw < ARRAY_SIZE(rx51_temp_table1)) - return rx51_temp_table1[raw] * 100; + return rx51_temp_table1[raw] * 10; /* Binary search RAW value in second inverse table */ while (max - min > 1) { @@ -133,7 +133,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di) break; } - return (rx51_temp_table2_first - min) * 100; + return (rx51_temp_table2_first - min) * 10; } /* @@ -203,7 +203,7 @@ static int rx51_battery_probe(struct platform_device *pdev) struct rx51_device_info *di; int ret; - di = kzalloc(sizeof(*di), GFP_KERNEL); + di = devm_kzalloc(&pdev->dev, sizeof(*di), GFP_KERNEL); if (!di) return -ENOMEM; @@ -218,7 +218,6 @@ static int rx51_battery_probe(struct platform_device *pdev) ret = power_supply_register(di->dev, &di->bat); if (ret) { platform_set_drvdata(pdev, NULL); - kfree(di); return ret; } @@ -231,7 +230,6 @@ static int rx51_battery_remove(struct platform_device *pdev) power_supply_unregister(&di->bat); platform_set_drvdata(pdev, NULL); - kfree(di); return 0; } |