Re: [PATCH] iio: core: return ENODEV if ioctl is unknown

From: Linus Walleij
Date: Wed May 05 2021 - 08:52:39 EST


On Mon, May 3, 2021 at 4:43 PM Alexandru Ardelean <aardelean@xxxxxxxxxxx> wrote:

> When the ioctl() mechanism was introduced in IIO core to centralize the
> registration of all ioctls in one place via commit 8dedcc3eee3ac ("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@xxxxxxxxxxxxxxx/
>
> Fixes: 8dedcc3eee3ac ("iio: core: centralize ioctl() calls to the main chardev")
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Cc: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
> Cc: Nuno Sa <nuno.sa@xxxxxxxxxx>
> Signed-off-by: Alexandru Ardelean <aardelean@xxxxxxxxxxx>

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij