lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri,  5 Jun 2015 14:11:54 -0600
From:	Shuah Khan <shuahkh@....samsung.com>
To:	mchehab@....samsung.com
Cc:	Shuah Khan <shuahkh@....samsung.com>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] media: define Media Controller API when CONFIG_MEDIA_CONTROLLER enabled

Change to define Media Controller API when CONFIG_MEDIA_CONTROLLER
is enabled. Define stubs for CONFIG_MEDIA_CONTROLLER disabled case.
This will help avoid drivers needing to enclose Media Controller
code within ifdef CONFIG_MEDIA_CONTROLLER block.

Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
---
 drivers/media/media-device.c |  4 ++++
 include/media/media-device.h | 27 +++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index a4d5b24..c55ab50 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -30,6 +30,8 @@
 #include <media/media-devnode.h>
 #include <media/media-entity.h>
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+
 /* -----------------------------------------------------------------------------
  * Userspace API
  */
@@ -495,3 +497,5 @@ struct media_device *media_device_find_devres(struct device *dev)
 	return devres_find(dev, media_device_release_devres, NULL, NULL);
 }
 EXPORT_SYMBOL_GPL(media_device_find_devres);
+
+#endif /* CONFIG_MEDIA_CONTROLLER */
diff --git a/include/media/media-device.h b/include/media/media-device.h
index 22792cd..a44f18f 100644
--- a/include/media/media-device.h
+++ b/include/media/media-device.h
@@ -80,6 +80,8 @@ struct media_device {
 			   unsigned int notification);
 };
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+
 /* Supported link_notify @notification values. */
 #define MEDIA_DEV_NOTIFY_PRE_LINK_CH	0
 #define MEDIA_DEV_NOTIFY_POST_LINK_CH	1
@@ -102,4 +104,29 @@ struct media_device *media_device_find_devres(struct device *dev);
 #define media_device_for_each_entity(entity, mdev)			\
 	list_for_each_entry(entity, &(mdev)->entities, list)
 
+#else
+static inline int media_device_register(struct media_device *mdev)
+{
+	return 0;
+}
+static inline void media_device_unregister(struct media_device *mdev)
+{
+}
+static inline int media_device_register_entity(struct media_device *mdev,
+						struct media_entity *entity)
+{
+	return 0;
+}
+static inline void media_device_unregister_entity(struct media_entity *entity)
+{
+}
+static inline struct media_device *media_device_get_devres(struct device *dev)
+{
+	return NULL;
+}
+static inline struct media_device *media_device_find_devres(struct device *dev)
+{
+	return NULL;
+}
+#endif /* CONFIG_MEDIA_CONTROLLER */
 #endif
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ