thermal: int3403: Delete a check before thermal_zone_device_unregister()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 1 Dec 2014 04:45:42 +0000 (05:45 +0100)
committerZhang Rui <rui.zhang@intel.com>
Tue, 9 Dec 2014 03:31:18 +0000 (11:31 +0800)
The thermal_zone_device_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: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/int340x_thermal/int3403_thermal.c

index 6e9fb62eb8170213149de3800cca3fa858b3a3e1..790b8f6da731624f419c0e100c4647b661c16635 100644 (file)
@@ -293,8 +293,7 @@ static int int3403_sensor_add(struct int3403_priv *priv)
        return 0;
 
  err_free_obj:
-       if (obj->tzone)
-               thermal_zone_device_unregister(obj->tzone);
+       thermal_zone_device_unregister(obj->tzone);
        return result;
 }