Commit 1a965d40 authored by Bijosh Thykkoottathil's avatar Bijosh Thykkoottathil Committed by Jonathan Cameron

drivers:iio:accel:mma8452: added cleanup provision in case of failure.

mma8452_set_freefall_mode can return -ve value in case if
i2c_smbus_read_byte_data fails. This function is called from mma8452_probe,
and returning -ve value from probe indicates probe failure. Need to call
iio_triggered_buffer_cleanup & iio_trigger_cleanup in this case.
Signed-off-by: default avatarBijosh Thykkoottathil <bijosh.t@hotmail.com>
Acked-by: default avatarMartin Kepplinger <martink@posteo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 21d41655
......@@ -1579,8 +1579,8 @@ static int mma8452_probe(struct i2c_client *client,
goto buffer_cleanup;
ret = mma8452_set_freefall_mode(data, false);
if (ret)
return ret;
if (ret < 0)
goto buffer_cleanup;
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment