media: atomisp: fix enum formats logic
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 25 Oct 2021 08:06:52 +0000 (09:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:09 +0000 (11:03 +0100)
commit37d7ebf0179be9685fcd80fea1dcb4a8b19602a8
treea6d356c3f6a4ba1c87ede817aa4932b1460a53dc
parenta030bcd96ef464b2aa8aa059f21b4d0396428a8c
media: atomisp: fix enum formats logic

[ Upstream commit fae46cb0531b45c789e39128f676f2bafa3a7b47 ]

Changeset 374d62e7aa50 ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument")
added an extra verification for a pads parameter for enum mbus
format code.

Such change broke atomisp, because now the V4L2 core
refuses to enum MBUS formats if the state is empty.

So, add .which field in order to select the active formats,
in order to make it work again.

While here, improve error messages.

Fixes: 374d62e7aa50 ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_ioctl.c