Skip to content

Commit

Permalink
staging: vc04_services: isp: Remove duplicated initialisation
Browse files Browse the repository at this point in the history
With the codec code from which this was derived, the driver had to
get the supported formats for both input and output ports.
This had been copied across, however here we have independent nodes
for each port, but the code had been left in to do the same thing
twice.
Remove the duplicate.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 authored and pelwell committed May 1, 2020
1 parent dde08eb commit 375920f
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions drivers/staging/vc04_services/bcm2835-isp/bcm2835-v4l2-isp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1160,41 +1160,6 @@ static int bcm2835_isp_get_supported_fmts(struct bcm2835_isp_node *node)
}
node->supported_fmts.num_entries = j;

param_size = sizeof(fourccs);
ret = vchiq_mmal_port_parameter_get(dev->mmal_instance,
get_port_data(node),
MMAL_PARAMETER_SUPPORTED_ENCODINGS,
&fourccs, &param_size);

if (ret) {
if (ret == MMAL_MSG_STATUS_ENOSPC) {
v4l2_err(&dev->v4l2_dev,
"%s: port has more encoding than we provided space for. Some are dropped.\n",
__func__);
num_encodings = MAX_SUPPORTED_ENCODINGS;
} else {
return -EINVAL;
}
} else {
num_encodings = param_size / sizeof(u32);
}
/* Assume at this stage that all encodings will be supported in V4L2. */
list = devm_kzalloc(dev->dev,
sizeof(struct bcm2835_isp_fmt) * num_encodings,
GFP_KERNEL);
if (!list)
return -ENOMEM;
node->supported_fmts.list = list;

for (i = 0, j = 0; i < num_encodings; i++) {
const struct bcm2835_isp_fmt *fmt = get_fmt(fourccs[i]);

if (fmt) {
list[j] = *fmt;
j++;
}
}
node->supported_fmts.num_entries = j;
return 0;
}

Expand Down

0 comments on commit 375920f

Please sign in to comment.