Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753075AbdGHSMX (ORCPT ); Sat, 8 Jul 2017 14:12:23 -0400 Received: from mga03.intel.com ([134.134.136.65]:11829 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043AbdGHSMW (ORCPT ); Sat, 8 Jul 2017 14:12:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,330,1496127600"; d="scan'208";a="1149549315" From: sathyanarayanan.kuppuswamy@linux.intel.com To: peda@axentia.se Cc: linux-kernel@vger.kernel.org, sathyaosid@gmail.com, Kuppuswamy Sathyanarayanan Subject: [PATCH v2 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case Date: Sat, 8 Jul 2017 11:12:05 -0700 Message-Id: <83ff1554464c781df142117ed30430476ec73634.1499537263.git.sathyanarayanan.kuppuswamy@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1752 Lines: 69 From: Kuppuswamy Sathyanarayanan Add dummy functions to avoid compile time issues when CONFIG_MULTIPLEXER is not enabled. Signed-off-by: Kuppuswamy Sathyanarayanan --- 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