summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2022-02-24 14:57:47 +0200
committerSakari Ailus <sakari.ailus@linux.intel.com>2022-03-04 00:27:09 +0200
commit443bf23d0048e014065d1a7fac8144fb0a40805b (patch)
tree2abbf6f1fda54cdf1bee0523d9e20e2a4d32c65d /include
parentff43dd75157e74fb37da96656b14264aac4252bd (diff)
downloadlinux-443bf23d0048e014065d1a7fac8144fb0a40805b.tar.bz2
media: media-entity: Clarify media_entity_cleanup() usage
Being able to call cleanup functions on objects that haven't been initialized but whose memory has been zeroed simplifies error handling. The media_entity_cleanup() function documentation doesn't tell whether this is allowed or not, and inspection of its implementation doesn't provide any clue as the function is currently empty. Update the documentation to explicitly allow this usage pattern. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/media-entity.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 33ee595c13f4..742918962d46 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -654,6 +654,10 @@ 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).
+ *
+ * Calling media_entity_cleanup() on a media_entity whose memory has been
+ * zeroed but that has not been initialized with media_entity_pad_init() is
+ * valid and is a no-op.
*/
#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)
static inline void media_entity_cleanup(struct media_entity *entity) {}