ti-soc-thermal: Delete an unnecessary check before the function call "cpufreq_cooling...
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 3 Feb 2015 10:15:14 +0000 (11:15 +0100)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 24 Feb 2015 18:26:56 +0000 (14:26 -0400)
The cpufreq_cooling_unregister() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/ti-soc-thermal/ti-thermal-common.c

index 3fb054a10f6a0fde450e29a98ee4cdf90e18f6c7..a38c1756442aa2611e0e207466aabba4e72b94cc 100644 (file)
@@ -429,7 +429,7 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
 
        data = ti_bandgap_get_sensor_data(bgp, id);
 
-       if (data && data->cool_dev)
+       if (data)
                cpufreq_cooling_unregister(data->cool_dev);
 
        return 0;