Re: [linux-next:master 2008/11103] drivers/iio/magnetometer/yamaha-yas530.c:891 yas5xx_probe() warn: missing error code 'ret'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 15, 2021 at 3:40 PM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   07f7e57c63aaa2afb4ea31edef05e08699a63a00
> commit: de8860b1ed4701ea7e6f760f02d79ca6a3b656a1 [2008/11103] iio: magnetometer: Add driver for Yamaha YAS530
> config: x86_64-randconfig-m001-20210215 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> smatch warnings:
> drivers/iio/magnetometer/yamaha-yas530.c:891 yas5xx_probe() warn: missing error code 'ret'

Indeed.

> de8860b1ed4701 Linus Walleij 2020-12-24  872    switch (yas5xx->devid) {
> de8860b1ed4701 Linus Walleij 2020-12-24  873    case YAS530_DEVICE_ID:
> de8860b1ed4701 Linus Walleij 2020-12-24  874            ret = yas530_get_calibration_data(yas5xx);
> de8860b1ed4701 Linus Walleij 2020-12-24  875            if (ret)
> de8860b1ed4701 Linus Walleij 2020-12-24  876                    goto assert_reset;
> de8860b1ed4701 Linus Walleij 2020-12-24  877            dev_info(dev, "detected YAS530 MS-3E %s",
> de8860b1ed4701 Linus Walleij 2020-12-24  878                     yas5xx->version ? "B" : "A");
> de8860b1ed4701 Linus Walleij 2020-12-24  879            strncpy(yas5xx->name, "yas530", sizeof(yas5xx->name));
> de8860b1ed4701 Linus Walleij 2020-12-24  880            break;
> de8860b1ed4701 Linus Walleij 2020-12-24  881    case YAS532_DEVICE_ID:
> de8860b1ed4701 Linus Walleij 2020-12-24  882            ret = yas532_get_calibration_data(yas5xx);
> de8860b1ed4701 Linus Walleij 2020-12-24  883            if (ret)
> de8860b1ed4701 Linus Walleij 2020-12-24  884                    goto assert_reset;
> de8860b1ed4701 Linus Walleij 2020-12-24  885            dev_info(dev, "detected YAS532/YAS533 MS-3R/F %s",
> de8860b1ed4701 Linus Walleij 2020-12-24  886                     yas5xx->version ? "AC" : "AB");
> de8860b1ed4701 Linus Walleij 2020-12-24  887            strncpy(yas5xx->name, "yas532", sizeof(yas5xx->name));
> de8860b1ed4701 Linus Walleij 2020-12-24  888            break;
> de8860b1ed4701 Linus Walleij 2020-12-24  889    default:
> de8860b1ed4701 Linus Walleij 2020-12-24  890            dev_err(dev, "unhandled device ID %02x\n", yas5xx->devid);
> de8860b1ed4701 Linus Walleij 2020-12-24 @891            goto assert_reset;
>
> "ret = -EINVAL;"

I think more of -ENODEV.

> de8860b1ed4701 Linus Walleij 2020-12-24  892    }


-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux