Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: ov2640: don't clear V4L2_SUBDEV_FL_IS_I2C

The v4l2_i2c_subdev_init() sets V4L2_SUBDEV_FL_IS_I2C flag in the
subdev->flags. But this driver overwrites subdev->flags immediately after
calling v4l2_i2c_subdev_init(). So V4L2_SUBDEV_FL_IS_I2C is not set after
all.

This stops breaking subdev->flags and preserves V4L2_SUBDEV_FL_IS_I2C.

Side note: According to the comment in v4l2_device_unregister(), this is
problematic only if the device is platform bus device. Device tree or
ACPI based devices are not affected.

Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Akinobu Mita and committed by
Mauro Carvalho Chehab
6b725eb6 baf1b186

+1 -1
+1 -1
drivers/media/i2c/ov2640.c
··· 1115 1115 goto err_clk; 1116 1116 1117 1117 v4l2_i2c_subdev_init(&priv->subdev, client, &ov2640_subdev_ops); 1118 - priv->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE; 1118 + priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 1119 1119 v4l2_ctrl_handler_init(&priv->hdl, 2); 1120 1120 v4l2_ctrl_new_std(&priv->hdl, &ov2640_ctrl_ops, 1121 1121 V4L2_CID_VFLIP, 0, 1, 1, 0);