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 <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
Sakari Ailus 2018-01-09 05:20:34 -05:00 • committed by Mauro Carvalho Chehab
commit 3580112b6d
7 changed files with 5 additions and 21 deletions

View file

@ -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.