diff options
| author | Dafna Hirschfeld <[email protected]> | 2019-10-03 12:59:42 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2019-10-24 22:03:28 +0000 |
| commit | 23df45d038662da2b1e017cf38165a88dfd7f543 (patch) | |
| tree | 2462c2b1ac4a8eb62e0056c7afa28ac72f07f3ab /drivers/media/platform/vimc/vimc-sensor.c | |
| parent | media: vimc: remove unused struct declaration vimc_platform_data (diff) | |
| download | kernel-23df45d038662da2b1e017cf38165a88dfd7f543.tar.gz kernel-23df45d038662da2b1e017cf38165a88dfd7f543.zip | |
media: vimc: embed the pads of entities in the entities' structs
since the pads array is of known small size, there is no reason to
allocate it separately. Instead, it is embedded in the entity struct.
This also conforms to the media controller doc:
'Most drivers will embed the pads array in a driver-specific structure,
avoiding dynamic allocation.'
Signed-off-by: Dafna Hirschfeld <[email protected]>
[[email protected]: remove unused vimc_pads_init()]
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-sensor.c')
| -rw-r--r-- | drivers/media/platform/vimc/vimc-sensor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index 14838362d871..b41e24a7d029 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -24,6 +24,7 @@ struct vimc_sen_device { /* The active format */ struct v4l2_mbus_framefmt mbus_format; struct v4l2_ctrl_handler hdl; + struct media_pad pad; }; static const struct v4l2_mbus_framefmt fmt_default = { @@ -292,7 +293,6 @@ static void vimc_sen_release(struct v4l2_subdev *sd) v4l2_ctrl_handler_free(&vsen->hdl); tpg_free(&vsen->tpg); media_entity_cleanup(vsen->ved.ent); - vimc_pads_cleanup(vsen->ved.pads); kfree(vsen); } @@ -367,10 +367,10 @@ struct vimc_ent_device *vimc_sen_add(struct vimc_device *vimc, goto err_free_hdl; /* Initialize ved and sd */ + vsen->pad.flags = MEDIA_PAD_FL_SOURCE; ret = vimc_ent_sd_register(&vsen->ved, &vsen->sd, v4l2_dev, vcfg_name, - MEDIA_ENT_F_CAM_SENSOR, 1, - (const unsigned long[1]) {MEDIA_PAD_FL_SOURCE}, + MEDIA_ENT_F_CAM_SENSOR, 1, &vsen->pad, &vimc_sen_int_ops, &vimc_sen_ops); if (ret) goto err_free_tpg; |
