iio: gyro: check sscanf return value
This patch fixes the checkpatch warnings: WARNING: unchecked sscanf return value Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Родитель
7d0ead5c3f
Коммит
a106b47489
|
@ -435,7 +435,9 @@ static int adis16136_initial_setup(struct iio_dev *indio_dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
sscanf(indio_dev->name, "adis%u\n", &device_id);
|
||||
ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
|
||||
if (ret != 1)
|
||||
return -EINVAL;
|
||||
|
||||
if (prod_id != device_id)
|
||||
dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.",
|
||||
|
|
Загрузка…
Ссылка в новой задаче