From e64837bf9e2c063d6b5bab51c0554a60270f636d Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 15 Feb 2021 16:30:23 +0100 Subject: [PATCH] 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 Reported-by: Dan Carpenter Suggested-by: Andy Shevchenko Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20210215153023.47899-1-linus.walleij@linaro.org Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/magnetometer/yamaha-yas530.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c index d46f23d82b3d..cee6207d8847 100644 --- a/drivers/iio/magnetometer/yamaha-yas530.c +++ b/drivers/iio/magnetometer/yamaha-yas530.c @@ -887,6 +887,7 @@ static int yas5xx_probe(struct i2c_client *i2c, strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name)); break; default: + ret = -ENODEV; dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid); goto assert_reset; }