]> git.baikalelectronics.ru Git - kernel.git/commit
iio: core: return ENODEV if ioctl is unknown
authorAlexandru Ardelean <aardelean@deviqon.com>
Mon, 3 May 2021 14:43:50 +0000 (17:43 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 10 May 2021 13:01:48 +0000 (14:01 +0100)
commit894a4f8998d4b0225e1e9dbc6cd3e0c2c61f91f9
treefd5adaf9bb141c9b1d8959c254b75fc73058860c
parent2bc6b9df9f410214539cc7962a81d4fc5ff529f2
iio: core: return ENODEV if ioctl is unknown

When the ioctl() mechanism was introduced in IIO core to centralize the
registration of all ioctls in one place via commit a3dd3a1b80d78 ("iio:
core: centralize ioctl() calls to the main chardev"), the return code was
changed from ENODEV to EINVAL, when the ioctl code isn't known.

This was done by accident.

This change reverts back to the old behavior, where if the ioctl() code
isn't known, ENODEV is returned (vs EINVAL).

This was brought into perspective by this patch:
  https://lore.kernel.org/linux-iio/20210428150815.136150-1-paul@crapouillou.net/

Fixes: a3dd3a1b80d78 ("iio: core: centralize ioctl() calls to the main chardev")
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Tested-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c