mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
media: camera: update kernel config checks
kernel drivers can be built as built-in (=y) or module (=m). The old ways of checking a driver is enabled or not is to use "#if define(CONFIG_XXX)" for built-in and "#if defined(CONFIG_xxx_MODULE)" for module. Switch to the new IS_ENABLED() macro which can check a driver is configured as built-in or module. Jira CAMERASW-10141 Change-Id: I9b7e3e911a587da19ca56cdc5ef610d9b4c52850 Signed-off-by: Frank Chen <frankc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2828089 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Igor Mitsyanko <imitsyanko@nvidia.com> Reviewed-by: Ankur Pawar <ankurp@nvidia.com> Reviewed-by: Matti Ryttylainen <mryttylainen@nvidia.com> Reviewed-by: Shiva Dubey <sdubey@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
843ab03d91
commit
ed8b9ea701
@@ -218,7 +218,7 @@ int tegracam_v4l2subdev_register(struct tegracam_device *tc_dev,
|
||||
/* Set owner to NULL so we can unload the driver module */
|
||||
sd->owner = NULL;
|
||||
|
||||
#if defined(CONFIG_MEDIA_CONTROLLER)
|
||||
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
|
||||
tc_dev->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.ops = &media_ops;
|
||||
err = tegra_media_entity_init(&sd->entity,
|
||||
@@ -245,7 +245,7 @@ void tegracam_v4l2subdev_unregister(struct tegracam_device *tc_dev)
|
||||
|
||||
v4l2_ctrl_handler_free(s_data->ctrl_handler);
|
||||
v4l2_async_unregister_subdev(sd);
|
||||
#if defined(CONFIG_MEDIA_CONTROLLER)
|
||||
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
|
||||
media_entity_cleanup(&sd->entity);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -746,7 +746,7 @@ static int tegra_channel_buffer_prepare(struct vb2_buffer *vb)
|
||||
|
||||
buf->chan = chan;
|
||||
vb2_set_plane_payload(&vbuf->vb2_buf, 0, chan->format.sizeimage);
|
||||
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
#if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
buf->addr = vb2_dma_contig_plane_dma_addr(vb, 0);
|
||||
#endif
|
||||
|
||||
@@ -2562,7 +2562,7 @@ int tegra_channel_init(struct tegra_channel *chan)
|
||||
/* Init bpl factor to 1, will be overidden based on interlace_type */
|
||||
chan->interlace_bplfactor = 1;
|
||||
|
||||
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
#if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
/* get the buffers queue... */
|
||||
ret = tegra_vb2_dma_init(vi_unit_dev, &chan->alloc_ctx,
|
||||
SZ_64K, &vi->vb2_dma_alloc_refcnt);
|
||||
@@ -2577,7 +2577,7 @@ int tegra_channel_init(struct tegra_channel *chan)
|
||||
chan->queue.drv_priv = chan;
|
||||
chan->queue.buf_struct_size = sizeof(struct tegra_channel_buffer);
|
||||
chan->queue.ops = &tegra_channel_queue_qops;
|
||||
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
#if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
chan->queue.mem_ops = &vb2_dma_contig_memops;
|
||||
#endif
|
||||
chan->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
|
||||
@@ -2602,7 +2602,7 @@ int tegra_channel_init(struct tegra_channel *chan)
|
||||
deskew_ctx_err:
|
||||
devm_kfree(vi->dev, chan->deskew_ctx);
|
||||
vb2_queue_error:
|
||||
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
#if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
tegra_vb2_dma_cleanup(vi_unit_dev, chan->alloc_ctx,
|
||||
&vi->vb2_dma_alloc_refcnt);
|
||||
vb2_init_error:
|
||||
@@ -2638,7 +2638,7 @@ int tegra_channel_cleanup(struct tegra_channel *chan)
|
||||
v4l2_ctrl_handler_free(&chan->ctrl_handler);
|
||||
mutex_lock(&chan->video_lock);
|
||||
vb2_queue_release(&chan->queue);
|
||||
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
#if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
|
||||
tegra_vb2_dma_cleanup(vi_unit_dev, chan->alloc_ctx,
|
||||
&chan->vi->vb2_dma_alloc_refcnt);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user