]> Pileus Git - ~andy/linux/blobdiff - drivers/power/rx51_battery.c
Merge tag 'mfd-3.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd...
[~andy/linux] / drivers / power / rx51_battery.c
index 35f625e18ba6ec01eae77841746ee8d63b87573f..cbde1d6d3228cb0078fb80490c9588bf20492b6a 100644 (file)
@@ -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;
 }