Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752235AbdGGVlb (ORCPT ); Fri, 7 Jul 2017 17:41:31 -0400 Received: from mga14.intel.com ([192.55.52.115]:50606 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbdGGVla (ORCPT ); Fri, 7 Jul 2017 17:41:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,325,1496127600"; d="scan'208";a="122552076" From: sathyanarayanan.kuppuswamy@linux.intel.com To: peda@axentia.se Cc: linux-kernel@vger.kernel.org, sathyaosid@gmail.com, Kuppuswamy Sathyanarayanan Subject: [PATCH v1 1/1] mux: consumer: Add dummy functions for !CONFIG_MULTIPLEXER case Date: Fri, 7 Jul 2017 14:41:12 -0700 Message-Id: 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: 1686 Lines: 66 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(+) diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h index 5577e1b..744a5b8 100644 --- a/include/linux/mux/consumer.h +++ b/include/linux/mux/consumer.h @@ -16,6 +16,7 @@ struct device; struct mux_control; +#ifdef 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