summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@collabora.com>2021-01-18 04:52:45 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-06 10:40:36 +0300
commitc1cf3d896d124e3e00794f9bfbde49f0fc279e3f (patch)
tree40a706481c461b75bdc74d64f1746ea56483274f /drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
parent38a50230292f232852f4e648d5e0a1cfaf37081b (diff)
downloadlinux-c1cf3d896d124e3e00794f9bfbde49f0fc279e3f.tar.xz
media: v4l2-async: Clean v4l2_async_notifier_add_fwnode_remote_subdev
Change v4l2_async_notifier_add_fwnode_remote_subdev semantics so it allocates the struct v4l2_async_subdev pointer. This makes the API consistent: the v4l2-async subdevice addition functions have now a unified usage model. This model is simpler, as it makes v4l2-async responsible for the allocation and release of the subdevice descriptor, and no longer something the driver has to worry about. On the user side, the change makes the API simpler for the drivers to use and less error-prone. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c')
-rw-r--r--drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
index ec46cff80fdb..3f94b8c966f3 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
+++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
@@ -118,6 +118,7 @@ static int sun4i_csi_notifier_init(struct sun4i_csi *csi)
struct v4l2_fwnode_endpoint vep = {
.bus_type = V4L2_MBUS_PARALLEL,
};
+ struct v4l2_async_subdev *asd;
struct fwnode_handle *ep;
int ret;
@@ -134,10 +135,12 @@ static int sun4i_csi_notifier_init(struct sun4i_csi *csi)
csi->bus = vep.bus.parallel;
- ret = v4l2_async_notifier_add_fwnode_remote_subdev(&csi->notifier,
- ep, &csi->asd);
- if (ret)
+ asd = v4l2_async_notifier_add_fwnode_remote_subdev(&csi->notifier,
+ ep, sizeof(*asd));
+ if (IS_ERR(asd)) {
+ ret = PTR_ERR(asd);
goto out;
+ }
csi->notifier.ops = &sun4i_csi_notify_ops;