iio: magnetometer: yas530: Fix return value on error path

There was a missed return variable assignment in the
default errorpath of the switch statement in yas5xx_probe().
Fix it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210215153023.47899-1-linus.walleij@linaro.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Linus Walleij 2021-02-15 16:30:23 +01:00 коммит произвёл Jonathan Cameron
Родитель 032aec339c
Коммит e64837bf9e
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -887,6 +887,7 @@ static int yas5xx_probe(struct i2c_client *i2c,
strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name)); strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name));
break; break;
default: default:
ret = -ENODEV;
dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid); dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid);
goto assert_reset; goto assert_reset;
} }