]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
thermal: palmas: no need to free devm_ memory on remove
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 23 Apr 2014 10:10:04 +0000 (15:40 +0530)
committerRiham Haidar <rhaidar@nvidia.com>
Mon, 5 May 2014 21:12:02 +0000 (14:12 -0700)
It is not required to free the memory which is allocated using devm_.
The device framework take care or releasing the memory.

Change-Id: I40d4815d4ae1385ad3715421b505bec227e3d1b1
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/400355
Reviewed-on: http://git-master/r/405009
GVS: Gerrit_Virtual_Submit

drivers/thermal/palmas_thermal.c

index 72acaf411c42d772cfa0fb1007db2cf249e0c6c5..96a160a611ea1d829cc6ac9df1b0c13d28d263e2 100644 (file)
@@ -225,9 +225,8 @@ static int palmas_thermal_remove(struct platform_device *pdev)
 {
        struct palmas_therm_zone *ptherm_zone = platform_get_drvdata(pdev);
 
-       thermal_zone_device_unregister(ptherm_zone->tz_device);
        free_irq(ptherm_zone->irq, ptherm_zone);
-       kfree(ptherm_zone);
+       thermal_zone_device_unregister(ptherm_zone->tz_device);
        return 0;
 }