diff mbox series

[19/26] media: Add nop implementations of media_device_{init,cleanup}

Message ID 20230201214535.347075-20-sakari.ailus@linux.intel.com
State New
Headers show
Series Media device lifetime management | expand

Commit Message

Sakari Ailus Feb. 1, 2023, 9:45 p.m. UTC
To support compliation with Media controller disabled, drivers were
required to conditionally call media_device_init and media_device_cleanup.
Add nop implementations of both so drivers don't need to care (or at least
care less).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/media-device.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/include/media/media-device.h b/include/media/media-device.h
index 7e8bca6756ba..780440bbb39d 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -460,6 +460,11 @@  void __media_device_usb_init(struct media_device *mdev,
 #else
 #define media_device_get(mdev) do { } while (0)
 #define media_device_put(mdev) do { } while (0)
+
+static inline void media_device_init(struct media_device *mdev)
+{
+}
+
 static inline int media_device_register(struct media_device *mdev)
 {
 	return 0;
@@ -467,6 +472,11 @@  static inline int media_device_register(struct media_device *mdev)
 static inline void media_device_unregister(struct media_device *mdev)
 {
 }
+
+static inline void media_device_cleanup(struct media_device *mdev)
+{
+}
+
 static inline int media_device_register_entity(struct media_device *mdev,
 						struct media_entity *entity)
 {