summaryrefslogtreecommitdiff
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-11-03 05:27:51 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-09 17:20:09 +0300
commit68429f50ab60074e58b98010103fcc5bac4afd54 (patch)
tree79238fd7fd84b0d20692ef653c735c0fe22dfc57 /drivers/media/media-entity.c
parentdc3cdbc9d4dc22948d7f934789ee71baba55bc82 (diff)
downloadlinux-68429f50ab60074e58b98010103fcc5bac4afd54.tar.xz
[media] media: Move media_device link_notify operation to an ops structure
This will allow adding new operations without increasing the media_device structure size for drivers that don't implement any media device operation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 9014362e904d..c68239e60487 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -808,17 +808,18 @@ int __media_entity_setup_link(struct media_link *link, u32 flags)
mdev = source->graph_obj.mdev;
- if (mdev->link_notify) {
- ret = mdev->link_notify(link, flags,
- MEDIA_DEV_NOTIFY_PRE_LINK_CH);
+ if (mdev->ops && mdev->ops->link_notify) {
+ ret = mdev->ops->link_notify(link, flags,
+ MEDIA_DEV_NOTIFY_PRE_LINK_CH);
if (ret < 0)
return ret;
}
ret = __media_entity_setup_link_notify(link, flags);
- if (mdev->link_notify)
- mdev->link_notify(link, flags, MEDIA_DEV_NOTIFY_POST_LINK_CH);
+ if (mdev->ops && mdev->ops->link_notify)
+ mdev->ops->link_notify(link, flags,
+ MEDIA_DEV_NOTIFY_POST_LINK_CH);
return ret;
}