media: max2175: don't clear V4L2_SUBDEV_FL_IS_I2C
authorAkinobu Mita <akinobu.mita@gmail.com>
Thu, 19 Oct 2017 16:31:21 +0000 (12:31 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Oct 2017 16:08:13 +0000 (12:08 -0400)
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>
Acked-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/max2175.c

index bf0e821a2b9334cb874f2bcd051dd26a25788f04..2f1966bdc47329ef1f897154b3824ea7866da35f 100644 (file)
@@ -1345,7 +1345,7 @@ static int max2175_probe(struct i2c_client *client,
        v4l2_i2c_subdev_init(sd, client, &max2175_ops);
        ctx->client = client;
 
-       sd->flags = V4L2_SUBDEV_FL_HAS_DEVNODE;
+       sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        /* Controls */
        hdl = &ctx->ctrl_hdl;