media: staging/imx: Move add_video_device into capture_device_register
Move imx_media_add_video_device() into imx_media_capture_device_register(). Also the former has no error conditions to convert to void. Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
34ff38745b
commit
3e80d125b5
@ -1237,7 +1237,6 @@ static int prp_s_frame_interval(struct v4l2_subdev *sd,
|
|||||||
static int prp_registered(struct v4l2_subdev *sd)
|
static int prp_registered(struct v4l2_subdev *sd)
|
||||||
{
|
{
|
||||||
struct prp_priv *priv = sd_to_priv(sd);
|
struct prp_priv *priv = sd_to_priv(sd);
|
||||||
struct imx_ic_priv *ic_priv = priv->ic_priv;
|
|
||||||
int i, ret;
|
int i, ret;
|
||||||
u32 code;
|
u32 code;
|
||||||
|
|
||||||
@ -1267,10 +1266,6 @@ static int prp_registered(struct v4l2_subdev *sd)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = imx_media_add_video_device(ic_priv->md, priv->vdev);
|
|
||||||
if (ret)
|
|
||||||
goto unreg;
|
|
||||||
|
|
||||||
ret = prp_init_controls(priv);
|
ret = prp_init_controls(priv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto unreg;
|
goto unreg;
|
||||||
|
@ -774,6 +774,9 @@ int imx_media_capture_device_register(struct imx_media_video_dev *vdev)
|
|||||||
|
|
||||||
vfd->ctrl_handler = &priv->ctrl_hdlr;
|
vfd->ctrl_handler = &priv->ctrl_hdlr;
|
||||||
|
|
||||||
|
/* add vdev to the video device list */
|
||||||
|
imx_media_add_video_device(priv->md, vdev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
unreg:
|
unreg:
|
||||||
video_unregister_device(vfd);
|
video_unregister_device(vfd);
|
||||||
|
@ -1816,13 +1816,8 @@ static int csi_registered(struct v4l2_subdev *sd)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto free_fim;
|
goto free_fim;
|
||||||
|
|
||||||
ret = imx_media_add_video_device(priv->md, priv->vdev);
|
|
||||||
if (ret)
|
|
||||||
goto unreg;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
unreg:
|
|
||||||
imx_media_capture_device_unregister(priv->vdev);
|
|
||||||
free_fim:
|
free_fim:
|
||||||
if (priv->fim)
|
if (priv->fim)
|
||||||
imx_media_fim_free(priv->fim);
|
imx_media_fim_free(priv->fim);
|
||||||
|
@ -763,10 +763,10 @@ imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd,
|
|||||||
EXPORT_SYMBOL_GPL(imx_media_find_subdev_by_devname);
|
EXPORT_SYMBOL_GPL(imx_media_find_subdev_by_devname);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds a video device to the master video device list. This is called by
|
* Adds a video device to the master video device list. This is called
|
||||||
* an async subdev that owns a video device when it is registered.
|
* when a video device is registered.
|
||||||
*/
|
*/
|
||||||
int imx_media_add_video_device(struct imx_media_dev *imxmd,
|
void imx_media_add_video_device(struct imx_media_dev *imxmd,
|
||||||
struct imx_media_video_dev *vdev)
|
struct imx_media_video_dev *vdev)
|
||||||
{
|
{
|
||||||
mutex_lock(&imxmd->mutex);
|
mutex_lock(&imxmd->mutex);
|
||||||
@ -774,7 +774,6 @@ int imx_media_add_video_device(struct imx_media_dev *imxmd,
|
|||||||
list_add_tail(&vdev->list, &imxmd->vdev_list);
|
list_add_tail(&vdev->list, &imxmd->vdev_list);
|
||||||
|
|
||||||
mutex_unlock(&imxmd->mutex);
|
mutex_unlock(&imxmd->mutex);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(imx_media_add_video_device);
|
EXPORT_SYMBOL_GPL(imx_media_add_video_device);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ imx_media_find_subdev_by_fwnode(struct imx_media_dev *imxmd,
|
|||||||
struct v4l2_subdev *
|
struct v4l2_subdev *
|
||||||
imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd,
|
imx_media_find_subdev_by_devname(struct imx_media_dev *imxmd,
|
||||||
const char *devname);
|
const char *devname);
|
||||||
int imx_media_add_video_device(struct imx_media_dev *imxmd,
|
void imx_media_add_video_device(struct imx_media_dev *imxmd,
|
||||||
struct imx_media_video_dev *vdev);
|
struct imx_media_video_dev *vdev);
|
||||||
int imx_media_find_mipi_csi2_channel(struct imx_media_dev *imxmd,
|
int imx_media_find_mipi_csi2_channel(struct imx_media_dev *imxmd,
|
||||||
struct media_entity *start_entity);
|
struct media_entity *start_entity);
|
||||||
|
@ -1126,17 +1126,7 @@ static int imx7_csi_registered(struct v4l2_subdev *sd)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = imx_media_capture_device_register(csi->vdev);
|
return imx_media_capture_device_register(csi->vdev);
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = imx_media_add_video_device(csi->imxmd, csi->vdev);
|
|
||||||
if (ret < 0) {
|
|
||||||
imx_media_capture_device_unregister(csi->vdev);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void imx7_csi_unregistered(struct v4l2_subdev *sd)
|
static void imx7_csi_unregistered(struct v4l2_subdev *sd)
|
||||||
|
Loading…
Reference in New Issue
Block a user