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:
Frank Chen
2022-12-14 09:06:03 -08:00
committed by mobile promotions
parent 843ab03d91
commit ed8b9ea701
2 changed files with 7 additions and 7 deletions

View File

@@ -218,7 +218,7 @@ int tegracam_v4l2subdev_register(struct tegracam_device *tc_dev,
/* Set owner to NULL so we can unload the driver module */ /* Set owner to NULL so we can unload the driver module */
sd->owner = NULL; sd->owner = NULL;
#if defined(CONFIG_MEDIA_CONTROLLER) #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
tc_dev->pad.flags = MEDIA_PAD_FL_SOURCE; tc_dev->pad.flags = MEDIA_PAD_FL_SOURCE;
sd->entity.ops = &media_ops; sd->entity.ops = &media_ops;
err = tegra_media_entity_init(&sd->entity, 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_ctrl_handler_free(s_data->ctrl_handler);
v4l2_async_unregister_subdev(sd); v4l2_async_unregister_subdev(sd);
#if defined(CONFIG_MEDIA_CONTROLLER) #if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&sd->entity); media_entity_cleanup(&sd->entity);
#endif #endif
} }

View File

@@ -746,7 +746,7 @@ static int tegra_channel_buffer_prepare(struct vb2_buffer *vb)
buf->chan = chan; buf->chan = chan;
vb2_set_plane_payload(&vbuf->vb2_buf, 0, chan->format.sizeimage); 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); buf->addr = vb2_dma_contig_plane_dma_addr(vb, 0);
#endif #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 */ /* Init bpl factor to 1, will be overidden based on interlace_type */
chan->interlace_bplfactor = 1; chan->interlace_bplfactor = 1;
#if defined(CONFIG_VIDEOBUF2_DMA_CONTIG) #if IS_ENABLED(CONFIG_VIDEOBUF2_DMA_CONTIG)
/* get the buffers queue... */ /* get the buffers queue... */
ret = tegra_vb2_dma_init(vi_unit_dev, &chan->alloc_ctx, ret = tegra_vb2_dma_init(vi_unit_dev, &chan->alloc_ctx,
SZ_64K, &vi->vb2_dma_alloc_refcnt); 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.drv_priv = chan;
chan->queue.buf_struct_size = sizeof(struct tegra_channel_buffer); chan->queue.buf_struct_size = sizeof(struct tegra_channel_buffer);
chan->queue.ops = &tegra_channel_queue_qops; 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; chan->queue.mem_ops = &vb2_dma_contig_memops;
#endif #endif
chan->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC chan->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC
@@ -2602,7 +2602,7 @@ int tegra_channel_init(struct tegra_channel *chan)
deskew_ctx_err: deskew_ctx_err:
devm_kfree(vi->dev, chan->deskew_ctx); devm_kfree(vi->dev, chan->deskew_ctx);
vb2_queue_error: 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, tegra_vb2_dma_cleanup(vi_unit_dev, chan->alloc_ctx,
&vi->vb2_dma_alloc_refcnt); &vi->vb2_dma_alloc_refcnt);
vb2_init_error: vb2_init_error:
@@ -2638,7 +2638,7 @@ int tegra_channel_cleanup(struct tegra_channel *chan)
v4l2_ctrl_handler_free(&chan->ctrl_handler); v4l2_ctrl_handler_free(&chan->ctrl_handler);
mutex_lock(&chan->video_lock); mutex_lock(&chan->video_lock);
vb2_queue_release(&chan->queue); 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, tegra_vb2_dma_cleanup(vi_unit_dev, chan->alloc_ctx,
&chan->vi->vb2_dma_alloc_refcnt); &chan->vi->vb2_dma_alloc_refcnt);
#endif #endif