From patchwork Fri Feb 5 04:39:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 1436428 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dTvweZTe; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DX2mC2mXdz9sWw for ; Fri, 5 Feb 2021 15:40:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9486B82A1E; Fri, 5 Feb 2021 05:40:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dTvweZTe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E742982A18; Fri, 5 Feb 2021 05:40:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE78B829A1 for ; Fri, 5 Feb 2021 05:39:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x734.google.com with SMTP id a7so5722994qkb.13 for ; Thu, 04 Feb 2021 20:39:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vJZtgUpIEltJD1LF4jkJ7ouYq4OFu4QXtLubxsyqWNw=; b=dTvweZTeE5+TwmS9K1oRJzjeG+H4TtBNxOtjFY7GQ2szxi6jTzRZQYkoXBTMQ+o52n iRN2iP6nO3r2qb6h1hqnyIRn8kJ1UZjguhdheANm7FeDBLR+o3hZd9yLq9KkOOn6dN/O cwQ/HO+ys8HjNo9+BLRmFQcDPIr0/oMKQqdlhz9ILtLjQDVJiywsTnTgdPi7NzMB+aIC U5XuOHGCRwMUNIqmHtcgjKZiUW/UJ45aaDWtA3Sx23RxmjvAhdBWgegXzfTneMd1mQc8 6LaMmqvuwixAB5JNWhtq6ynEWjw2ICnbip6Lg5OPDRFtLSlhMj0p5l+sYBU6/oaKA6Wi 37TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vJZtgUpIEltJD1LF4jkJ7ouYq4OFu4QXtLubxsyqWNw=; b=W2HUSeVw+vxHDT2ya2stj5PJ5PqWt3XfTZgUhB5dzVCFH+cQAr3pC9dAjIrNG1L+Q0 zr+Bilc/HMSrvUV4UKjk8rYxH91GyRp7cLLUrKy6Fnc8sWyB8QvhS0ipwEwbllEa/QIw 2C9Xoaks566DrIxGrf1dRGFCBU16qmMCC2zWbiNUGLqG4qJRbUuPcg3hw9Oj8hSk2L+c iAkd7//MmJdC7A0KjxE/CCQH/6M1kOLZLjAxWZFOMmGG8qEz8fbVZY14AXhJvmu4qTRz 1G0dsPXOlgqWHsI7Ll5XaZpJFwUISlEvAZciWFgtUbTZuzdWSYqtzoSr4TBilpT3nalz tqiQ== X-Gm-Message-State: AOAM533mBxHDaBqolTXu9IOQt3j2gHmaIV1iocIoYmqvCFvgGjZi7dri Csrr2iNoRVm4fgjQGyda4JT9gvrjkzk= X-Google-Smtp-Source: ABdhPJz4TGcb7nGRarys+HhXsw7hoD/MbE2S9ATZG5O9ZVlzSzYur9q3Ss+gnPYk4durkpxYxMhcmA== X-Received: by 2002:a37:af86:: with SMTP id y128mr2525510qke.173.1612499998602; Thu, 04 Feb 2021 20:39:58 -0800 (PST) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id a47sm7045020qtk.44.2021.02.04.20.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 20:39:58 -0800 (PST) From: Sean Anderson To: u-boot@lists.denx.de Cc: Jagan Teki , Sean Anderson , Jean-Jacques Hiblot , Pratyush Yadav , Simon Glass Subject: [RFC PATCH 05/13] mux: Inline mux functions when CONFIG_MUX is disabled Date: Thu, 4 Feb 2021 23:39:15 -0500 Message-Id: <20210205043924.149504-6-seanga2@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205043924.149504-1-seanga2@gmail.com> References: <20210205043924.149504-1-seanga2@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean This prevents multiple-definition errors. Fixes: 0ad40b2463 ("drivers: Add a new framework for multiplexer devices") Signed-off-by: Sean Anderson Reviewed-by: Pratyush Yadav --- include/mux.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/include/mux.h b/include/mux.h index 23844f480a..91a89bbb9a 100644 --- a/include/mux.h +++ b/include/mux.h @@ -117,40 +117,41 @@ struct mux_control *devm_mux_control_get(struct udevice *dev, int dm_mux_init(void); #else -unsigned int mux_control_states(struct mux_control *mux) +static inline unsigned int mux_control_states(struct mux_control *mux) { return -ENOSYS; } -int __must_check mux_control_select(struct mux_control *mux, - unsigned int state) +static inline int __must_check mux_control_select(struct mux_control *mux, + unsigned int state) { return -ENOSYS; } #define mux_control_try_select(mux) mux_control_select(mux) -int mux_control_deselect(struct mux_control *mux) +static inline int mux_control_deselect(struct mux_control *mux) { return -ENOSYS; } -struct mux_control *mux_control_get(struct udevice *dev, const char *mux_name) +static inline struct mux_control *mux_control_get(struct udevice *dev, + const char *mux_name) { return NULL; } -void mux_control_put(struct mux_control *mux) +static inline void mux_control_put(struct mux_control *mux) { } -struct mux_control *devm_mux_control_get(struct udevice *dev, - const char *mux_name) +static inline struct mux_control *devm_mux_control_get(struct udevice *dev, + const char *mux_name) { return NULL; } -int dm_mux_init(void) +static inline int dm_mux_init(void) { return -ENOSYS; }