提交 f0030d87 编写于 作者: A Axel Lin 提交者: Guenter Roeck

hwmon: (ad7414) Return proper error code for ad7414_probe()

Return proper error if i2c_check_functionality reports
the adapter does not support the capability we need.

Also remove unneeded initialization for err variable.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Acked-by: NSean MacLennan <smaclennan@pikatech.com>
Signed-off-by: NGuenter Roeck <guenter.roeck@ericsson.com>
上级 f7334b4c
......@@ -178,11 +178,13 @@ static int ad7414_probe(struct i2c_client *client,
{
struct ad7414_data *data;
int conf;
int err = 0;
int err;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_READ_WORD_DATA))
I2C_FUNC_SMBUS_READ_WORD_DATA)) {
err = -EOPNOTSUPP;
goto exit;
}
data = kzalloc(sizeof(struct ad7414_data), GFP_KERNEL);
if (!data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册