mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
media: Allow drivers to be built without V4L2
When building the NVIDIA out-of-tree drivers against 3rd party Linux kernels where V4L2 support is not be enabled by default, the camera drivers fail to build. Although this is expected, it is preferred that the driver can still be built but then fail when loaded. Update the camera drivers to guard around the V4L2 functions so that the drivers can still be built but will return an error where needed. Bug 4119327 Change-Id: I3a1115e5f0451153831c396244c01d7525cb51a1 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979254 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
84302c4c14
commit
79e8e9cf3a
@@ -229,7 +229,11 @@ int tegracam_v4l2subdev_register(struct tegracam_device *tc_dev,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_V4L2_ASYNC)
|
||||
return v4l2_async_register_subdev(sd);
|
||||
#else
|
||||
return -ENOTSUPP;
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tegracam_v4l2subdev_register);
|
||||
|
||||
@@ -244,7 +248,9 @@ void tegracam_v4l2subdev_unregister(struct tegracam_device *tc_dev)
|
||||
sd = &s_data->subdev;
|
||||
|
||||
v4l2_ctrl_handler_free(s_data->ctrl_handler);
|
||||
#if defined(CONFIG_V4L2_ASYNC)
|
||||
v4l2_async_unregister_subdev(sd);
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
|
||||
media_entity_cleanup(&sd->entity);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user