media: sun6i-csi: Remove controls handler from the driver
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Fri, 26 Aug 2022 18:32:09 +0000 (20:32 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 24 Sep 2022 09:21:45 +0000 (11:21 +0200)
The driver does not expose controls directly and thus does not need
a controls handler for its own use.

Controls attached to subdevs used to be exposed that way, however this
can easily lead to issue when multiple subdevs attached to the same
v4l2 device expose the same controls. Subdev controls should be set
through each individual subdev node instead.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c

index e3d60b6..d74eaa3 100644 (file)
@@ -691,23 +691,14 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
                goto error_media;
        }
 
-       /* V4L2 Control Handler */
-
-       ret = v4l2_ctrl_handler_init(&v4l2->ctrl_handler, 0);
-       if (ret) {
-               dev_err(dev, "failed to init v4l2 control handler: %d\n", ret);
-               goto error_media;
-       }
-
        /* V4L2 Device */
 
        v4l2_dev->mdev = media_dev;
-       v4l2_dev->ctrl_handler = &v4l2->ctrl_handler;
 
        ret = v4l2_device_register(dev, v4l2_dev);
        if (ret) {
                dev_err(dev, "failed to register v4l2 device: %d\n", ret);
-               goto error_v4l2_ctrl;
+               goto error_media;
        }
 
        /* Video */
@@ -746,9 +737,6 @@ error_video:
 error_v4l2_device:
        v4l2_device_unregister(&v4l2->v4l2_dev);
 
-error_v4l2_ctrl:
-       v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
-
 error_media:
        media_device_unregister(media_dev);
        media_device_cleanup(media_dev);
@@ -765,7 +753,6 @@ static void sun6i_csi_v4l2_cleanup(struct sun6i_csi_device *csi_dev)
        v4l2_async_nf_cleanup(&v4l2->notifier);
        sun6i_video_cleanup(csi_dev);
        v4l2_device_unregister(&v4l2->v4l2_dev);
-       v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
        media_device_cleanup(&v4l2->media_dev);
 }
 
index e301d80..4bb4c3d 100644 (file)
@@ -8,7 +8,6 @@
 #ifndef __SUN6I_CSI_H__
 #define __SUN6I_CSI_H__
 
-#include <media/v4l2-ctrls.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-fwnode.h>
 
@@ -35,7 +34,6 @@ struct sun6i_csi_config {
 
 struct sun6i_csi_v4l2 {
        struct v4l2_device              v4l2_dev;
-       struct v4l2_ctrl_handler        ctrl_handler;
        struct media_device             media_dev;
 
        struct v4l2_async_notifier      notifier;
index 50e5136..d75f762 100644 (file)
@@ -486,10 +486,6 @@ static const struct v4l2_ioctl_ops sun6i_video_ioctl_ops = {
        .vidioc_dqbuf                   = vb2_ioctl_dqbuf,
        .vidioc_streamon                = vb2_ioctl_streamon,
        .vidioc_streamoff               = vb2_ioctl_streamoff,
-
-       .vidioc_log_status              = v4l2_ctrl_log_status,
-       .vidioc_subscribe_event         = v4l2_ctrl_subscribe_event,
-       .vidioc_unsubscribe_event       = v4l2_event_unsubscribe,
 };
 
 /* V4L2 File */