提交 a4bf06d5 编写于 作者: D Dan Carpenter 提交者: Guenter Roeck

hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0

The callers never check for negative but they sometimes check for zero
returns:

	int reg = ADT7462_REG_VOLT_MAX(data, i);
        data->volt_max[i] =
		(reg ? i2c_smbus_read_byte_data(client, reg) : 0);
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 60c1f31f
......@@ -333,7 +333,7 @@ static int ADT7462_REG_VOLT_MAX(struct adt7462_data *data, int which)
return 0x4C;
break;
}
return -ENODEV;
return 0;
}
static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which)
......@@ -392,7 +392,7 @@ static int ADT7462_REG_VOLT_MIN(struct adt7462_data *data, int which)
return 0x77;
break;
}
return -ENODEV;
return 0;
}
static int ADT7462_REG_VOLT(struct adt7462_data *data, int which)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册