提交 e8f45e33 编写于 作者: L Lars-Peter Clausen 提交者: Jonathan Cameron

staging:iio:adt7410: Fix adt7410_set_mode return value

The function is expected to return the number of bytes consumed and as long as
not all bytes have been consumed the function will be called again. Currently
the function returns 'ret', which will always be 0 in this case, so we end up in
a endless loop since the caller will assume that no bytes have been consumed. So
instead return len as it is supposed to.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 69bcd3bf
......@@ -181,7 +181,7 @@ static ssize_t adt7410_store_mode(struct device *dev,
chip->config = config;
return ret;
return len;
}
static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册