{
struct xscd_chan *chan;
struct v4l2_subdev *subdev;
+ unsigned int num_pads;
int ret;
- u32 num_pads;
chan = devm_kzalloc(xscd->dev, sizeof(*chan), GFP_KERNEL);
if (!chan)
/* Initialize media pads */
num_pads = xscd->memory_based ? 1 : 2;
- chan->pad = devm_kzalloc(chan->xscd->dev,
- sizeof(struct media_pad) * num_pads,
- GFP_KERNEL);
- if (!chan->pad)
- return -ENOMEM;
- chan->pad[XVIP_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
+ chan->pads[XVIP_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
if (!xscd->memory_based)
- chan->pad[XVIP_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
+ chan->pads[XVIP_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
- ret = media_entity_pads_init(&subdev->entity, num_pads, chan->pad);
+ ret = media_entity_pads_init(&subdev->entity, num_pads, chan->pads);
if (ret < 0)
goto error;
* @iomem: device I/O register space remapped to kernel virtual memory
* @xscd: SCD device
* @subdev: V4L2 subdevice
- * @pad: media pads
+ * @pads: media pads
* @format: active V4L2 media bus format for the pad
* @event: scene change event
* @dmachan: dma channel part of the scenechange stream
void __iomem *iomem;
struct xscd_device *xscd;
struct v4l2_subdev subdev;
- struct media_pad *pad;
+ struct media_pad pads[2];
struct v4l2_mbus_framefmt format;
struct v4l2_event event;
struct xscd_dma_chan dmachan;