]> git.itanic.dy.fi Git - linux-stable/commit
iio: adis16400: Fix an error code in adis16400_initial_setup()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 16 Feb 2021 19:42:13 +0000 (22:42 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Feb 2021 15:25:58 +0000 (15:25 +0000)
commita71266e454b5df10d019b06f5ebacd579f76be28
treeed9b81d1b2209ac79a726c55286d408cd51f33c0
parentbe24c65e9fa2486bb8ec98d9f592bdcf04bedd88
iio: adis16400: Fix an error code in adis16400_initial_setup()

This is to silence a new Smatch warning:

    drivers/iio/imu/adis16400.c:492 adis16400_initial_setup()
    warn: sscanf doesn't return error codes

If the condition "if (st->variant->flags & ADIS16400_HAS_SLOW_MODE) {"
is false then we return 1 instead of returning 0 and probe will fail.

Fixes: 72a868b38bdd ("iio: imu: check sscanf return value")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/YCwgFb3JVG6qrlQ+@mwanda
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/adis16400.c