Skip to content

Commit d6113cd

Browse files
tombamchehab
authored andcommitted
media: i2c: ds90ub913: Use v4l2_subdev_get_frame_desc_passthrough
Use the new v4l2_subdev_get_frame_desc_passthrough helper for .get_frame_desc. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 3ff6b67 commit d6113cd

1 file changed

Lines changed: 1 addition & 58 deletions

File tree

drivers/media/i2c/ds90ub913.c

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -372,63 +372,6 @@ static int ub913_set_routing(struct v4l2_subdev *sd,
372372
return _ub913_set_routing(sd, state, routing);
373373
}
374374

375-
static int ub913_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad,
376-
struct v4l2_mbus_frame_desc *fd)
377-
{
378-
struct ub913_data *priv = sd_to_ub913(sd);
379-
const struct v4l2_subdev_krouting *routing;
380-
struct v4l2_mbus_frame_desc source_fd;
381-
struct v4l2_subdev_route *route;
382-
struct v4l2_subdev_state *state;
383-
int ret;
384-
385-
if (pad != UB913_PAD_SOURCE)
386-
return -EINVAL;
387-
388-
ret = v4l2_subdev_call(priv->source_sd, pad, get_frame_desc,
389-
priv->source_sd_pad, &source_fd);
390-
if (ret)
391-
return ret;
392-
393-
fd->type = V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL;
394-
395-
state = v4l2_subdev_lock_and_get_active_state(sd);
396-
397-
routing = &state->routing;
398-
399-
for_each_active_route(routing, route) {
400-
unsigned int i;
401-
402-
if (route->source_pad != pad)
403-
continue;
404-
405-
for (i = 0; i < source_fd.num_entries; i++) {
406-
if (source_fd.entry[i].stream == route->sink_stream)
407-
break;
408-
}
409-
410-
if (i == source_fd.num_entries) {
411-
dev_err(&priv->client->dev,
412-
"Failed to find stream from source frame desc\n");
413-
ret = -EPIPE;
414-
goto out_unlock;
415-
}
416-
417-
fd->entry[fd->num_entries].stream = route->source_stream;
418-
fd->entry[fd->num_entries].flags = source_fd.entry[i].flags;
419-
fd->entry[fd->num_entries].length = source_fd.entry[i].length;
420-
fd->entry[fd->num_entries].pixelcode =
421-
source_fd.entry[i].pixelcode;
422-
423-
fd->num_entries++;
424-
}
425-
426-
out_unlock:
427-
v4l2_subdev_unlock_state(state);
428-
429-
return ret;
430-
}
431-
432375
static int ub913_set_fmt(struct v4l2_subdev *sd,
433376
struct v4l2_subdev_state *state,
434377
struct v4l2_subdev_format *format)
@@ -544,7 +487,7 @@ static const struct v4l2_subdev_pad_ops ub913_pad_ops = {
544487
.enable_streams = ub913_enable_streams,
545488
.disable_streams = ub913_disable_streams,
546489
.set_routing = ub913_set_routing,
547-
.get_frame_desc = ub913_get_frame_desc,
490+
.get_frame_desc = v4l2_subdev_get_frame_desc_passthrough,
548491
.get_fmt = v4l2_subdev_get_fmt,
549492
.set_fmt = ub913_set_fmt,
550493
};

0 commit comments

Comments
 (0)