Skip to content

Commit

Permalink
staging:iio:adt7410: Fix adt7410_set_mode return value
Browse files Browse the repository at this point in the history
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Nov 17, 2012
1 parent 69bcd3b commit e8f45e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/adc/adt7410.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e8f45e3

Please sign in to comment.