lkml.org 
[lkml]   [2017]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case
Date
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Add dummy functions to avoid compile time issues when CONFIG_MULTIPLEXER
is not enabled.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
---
include/linux/mux/consumer.h | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Changes since v1:
* Changed #ifdef to #if IS_ENABLED.

diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h
index 5577e1b..df78988 100644
--- a/include/linux/mux/consumer.h
+++ b/include/linux/mux/consumer.h
@@ -16,6 +16,7 @@
struct device;
struct mux_control;

+#if IS_ENABLED(CONFIG_MULTIPLEXER)
unsigned int mux_control_states(struct mux_control *mux);
int __must_check mux_control_select(struct mux_control *mux,
unsigned int state);
@@ -29,4 +30,41 @@ void mux_control_put(struct mux_control *mux);
struct mux_control *devm_mux_control_get(struct device *dev,
const char *mux_name);

+#else
+unsigned int mux_control_states(struct mux_control *mux)
+{
+ return -ENODEV;
+}
+
+int __must_check mux_control_select(struct mux_control *mux,
+ unsigned int state)
+{
+ return -ENODEV;
+}
+
+int __must_check mux_control_try_select(struct mux_control *mux,
+ unsigned int state)
+{
+ return -ENODEV;
+}
+
+int mux_control_deselect(struct mux_control *mux)
+{
+ return -ENODEV;
+}
+
+struct mux_control *mux_control_get(struct device *dev, const char *mux_name)
+{
+ return ERR_PTR(-ENODEV);
+}
+
+void mux_control_put(struct mux_control *mux) {}
+
+struct mux_control *devm_mux_control_get(struct device *dev,
+ const char *mux_name)
+{
+ return ERR_PTR(-ENODEV);
+}
+#endif
+
#endif /* _LINUX_MUX_CONSUMER_H */
--
2.7.4
\
 
 \ /
  Last update: 2017-07-08 20:12    [W:0.112 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site