aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2018-01-09 05:20:34 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-23 08:12:01 -0500
commit3580112b6d6f51725ba605c146db14af61e87628 (patch)
tree8b1aa45e1330526e66e5e047af75a4758c715f6f /include/media
parentmedia: ov5640: fix spurious streamon failures (diff)
downloadlinux-dev-3580112b6d6f51725ba605c146db14af61e87628.tar.xz
linux-dev-3580112b6d6f51725ba605c146db14af61e87628.zip
media: entity: Add a nop variant of media_entity_cleanup
Add nop variant of media_entity_cleanup. This allows calling media_entity_cleanup whether or not Media controller is enabled, simplifying driver code. Also drop #ifdefs on a few drivers around media_entity_cleanup(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-entity.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index d7a669058b5e..a732af1dbba0 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -634,7 +634,11 @@ int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
* This function must be called during the cleanup phase after unregistering
* the entity (currently, it does nothing).
*/
-static inline void media_entity_cleanup(struct media_entity *entity) {};
+#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
+static inline void media_entity_cleanup(struct media_entity *entity) {}
+#else
+#define media_entity_cleanup(entity) do { } while (false)
+#endif
/**
* media_create_pad_link() - creates a link between two entities.