media: rockchip: isp1: add check for get_remote_sensor

Change-Id: Ic09b394daa96aa8227b327f1e59713a359be8c18
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2019-01-29 16:57:40 +08:00
committed by Tao Huang
parent a1e42f742f
commit 044afbd6a3

View File

@@ -83,11 +83,17 @@ static inline struct rkisp1_device *sd_to_isp_dev(struct v4l2_subdev *sd)
/* Get sensor by enabled media link */
static struct v4l2_subdev *get_remote_sensor(struct v4l2_subdev *sd)
{
struct media_pad *local;
struct media_pad *local, *remote;
struct media_entity *sensor_me;
local = &sd->entity.pads[RKISP1_ISP_PAD_SINK];
sensor_me = media_entity_remote_pad(local)->entity;
if (!local)
return NULL;
remote = media_entity_remote_pad(local);
if (!remote)
return NULL;
sensor_me = remote->entity;
return media_entity_to_v4l2_subdev(sensor_me);
}