media: i2c: imx290: set the format before VIDIOC_SUBDEV_G_FMT is called
authorAndrey Konovalov <andrey.konovalov@linaro.org>
Fri, 12 Jun 2020 13:53:46 +0000 (15:53 +0200)
committerpopcornmix <popcornmix@gmail.com>
Wed, 27 Jan 2021 19:13:13 +0000 (19:13 +0000)
commit93fad8890c0438c82c1a95698add371e01920b43
treedcc742c36d55aa3dfa21d61eeafd51b02e33654d
parentcab0e746cd11d77d6ed47d283ae12214fdb7bf8b
media: i2c: imx290: set the format before VIDIOC_SUBDEV_G_FMT is called

Commit d46cfdc86c30d5ec768924f0b1e2683c8d20b671 upstream.

With the current driver 'media-ctl -p' issued right after the imx290 driver
is loaded prints:
pad0: Source
             [fmt:unknown/0x0]

The format value of zero is due to the current_format field of the imx290
struct not being initialized yet.

As imx290_entity_init_cfg() calls imx290_set_fmt(), the current_mode field
is also initialized, so the line which set current_mode to a default value
in driver's probe() function is no longer needed.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/imx290.c