@@ -531,9 +531,6 @@ static int thermal_get_mode(struct thermal_zone_device *thermal,
{
struct acpi_thermal *tz = thermal->devdata;
- if (!tz)
- return -EINVAL;
-
*mode = tz->tz_enabled ? THERMAL_DEVICE_ENABLED :
THERMAL_DEVICE_DISABLED;
@@ -546,9 +543,6 @@ static int thermal_set_mode(struct thermal_zone_device *thermal,
struct acpi_thermal *tz = thermal->devdata;
int enable;
- if (!tz)
- return -EINVAL;
-
/*
* enable/disable thermal management from ACPI thermal driver
*/
@@ -235,9 +235,6 @@ static int int3400_thermal_get_mode(struct thermal_zone_device *thermal,
{
struct int3400_thermal_priv *priv = thermal->devdata;
- if (!priv)
- return -EINVAL;
-
*mode = priv->mode;
return 0;
@@ -250,9 +247,6 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal,
bool enable;
int result = 0;
- if (!priv)
- return -EINVAL;
-
if (mode == THERMAL_DEVICE_ENABLED)
enable = true;
else if (mode == THERMAL_DEVICE_DISABLED)
This driver provides a non-NULL "devdata" argument for thermal_zone_device_register(). Thermal core never sets it to NULL afterwards, so checking for its being NULL in this driver makes no sense. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> --- drivers/acpi/thermal.c | 6 ------ drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 ------ 2 files changed, 12 deletions(-)