iio: adc: mcp3422: Checking for error on probe
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Wed, 28 Jun 2017 21:53:10 +0000 (23:53 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 2 Jul 2017 09:24:52 +0000 (10:24 +0100)
commit6be72b9067d443a44065541853edfb92ffca0401
tree3106e588b9b390f3f7b48d0c2e94c3de14ae968c
parente3169994f6563f7e80a357ea68d5e9b040cb126c
iio: adc: mcp3422: Checking for error on probe

Some part of the configuration are not touched after the probe
and if something goes wrong on writing the initial one,
the chip will misbehave.
Adding an error checking ensures that the inital configuration will
be written correctly. Moreover ensures that a sensible configuration
will be saved in driver data and used subsequently as intended.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Reported-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/mcp3422.c