Skip to content

Commit daafbb9

Browse files
paulkocialkowskimchehab
authored andcommitted
media: sun6i-csi: Remove controls handler from the driver
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent f9a6e56 commit daafbb9

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -691,23 +691,14 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
691691
goto error_media;
692692
}
693693

694-
/* V4L2 Control Handler */
695-
696-
ret = v4l2_ctrl_handler_init(&v4l2->ctrl_handler, 0);
697-
if (ret) {
698-
dev_err(dev, "failed to init v4l2 control handler: %d\n", ret);
699-
goto error_media;
700-
}
701-
702694
/* V4L2 Device */
703695

704696
v4l2_dev->mdev = media_dev;
705-
v4l2_dev->ctrl_handler = &v4l2->ctrl_handler;
706697

707698
ret = v4l2_device_register(dev, v4l2_dev);
708699
if (ret) {
709700
dev_err(dev, "failed to register v4l2 device: %d\n", ret);
710-
goto error_v4l2_ctrl;
701+
goto error_media;
711702
}
712703

713704
/* Video */
@@ -746,9 +737,6 @@ static int sun6i_csi_v4l2_setup(struct sun6i_csi_device *csi_dev)
746737
error_v4l2_device:
747738
v4l2_device_unregister(&v4l2->v4l2_dev);
748739

749-
error_v4l2_ctrl:
750-
v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
751-
752740
error_media:
753741
media_device_unregister(media_dev);
754742
media_device_cleanup(media_dev);
@@ -765,7 +753,6 @@ static void sun6i_csi_v4l2_cleanup(struct sun6i_csi_device *csi_dev)
765753
v4l2_async_nf_cleanup(&v4l2->notifier);
766754
sun6i_video_cleanup(csi_dev);
767755
v4l2_device_unregister(&v4l2->v4l2_dev);
768-
v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
769756
media_device_cleanup(&v4l2->media_dev);
770757
}
771758

drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#ifndef __SUN6I_CSI_H__
99
#define __SUN6I_CSI_H__
1010

11-
#include <media/v4l2-ctrls.h>
1211
#include <media/v4l2-device.h>
1312
#include <media/v4l2-fwnode.h>
1413

@@ -35,7 +34,6 @@ struct sun6i_csi_config {
3534

3635
struct sun6i_csi_v4l2 {
3736
struct v4l2_device v4l2_dev;
38-
struct v4l2_ctrl_handler ctrl_handler;
3937
struct media_device media_dev;
4038

4139
struct v4l2_async_notifier notifier;

drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ static const struct v4l2_ioctl_ops sun6i_video_ioctl_ops = {
486486
.vidioc_dqbuf = vb2_ioctl_dqbuf,
487487
.vidioc_streamon = vb2_ioctl_streamon,
488488
.vidioc_streamoff = vb2_ioctl_streamoff,
489-
490-
.vidioc_log_status = v4l2_ctrl_log_status,
491-
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
492-
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
493489
};
494490

495491
/* V4L2 File */

0 commit comments

Comments
 (0)