mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 19:26:01 -04:00
Staging: iio: Add error check on iio_register_device()
This patch checks if an error occurred on probe and stops the device in order to avoid wasting power. Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
675732707f
commit
b72eb70209
@@ -550,8 +550,15 @@ static int ade7754_probe(struct spi_device *spi)
|
||||
/* Get the device into a sane initial state */
|
||||
ret = ade7754_initial_setup(indio_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
return iio_device_register(indio_dev);
|
||||
goto powerdown_on_error;
|
||||
ret = iio_device_register(indio_dev);
|
||||
if (ret)
|
||||
goto powerdown_on_error;
|
||||
return ret;
|
||||
|
||||
powerdown_on_error:
|
||||
ade7754_stop_device(&indio_dev->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* fixme, confirm ordering in this function */
|
||||
|
||||
Reference in New Issue
Block a user