Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC8E2C32793 for ; Wed, 18 Jan 2023 12:12:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C88085620; Wed, 18 Jan 2023 13:12:49 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc 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; secure) header.d=walle.cc header.i=@walle.cc header.b="VsO56hGr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E63AE855F0; Wed, 18 Jan 2023 13:12:38 +0100 (CET) Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 574DC85603 for ; Wed, 18 Jan 2023 13:12:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 6C3651671; Wed, 18 Jan 2023 13:12:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1674043950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aDx56qjM+VT1/ppAQbhs7L+eAdq7UJ//a9BciSVexQ8=; b=VsO56hGrVR9nW0LtQhKgumRYbxYvsoS4spZVksHwWugzin1wtjlL5p1h787jRrL1K0veBt g7aKIqpB9H/H6JtR9t+ERv2dWyqbvecW76CkKd2oH0iBB3biEB/Asfw2VF0S6nSMJoSe/5 sWDR/uicL5DTzsRH9rgxfccaXs9hRx0DDirl89D6bQqVhvzNCxhZQD2dxN+QpGZoFPIvqt 6e2mDAmc/clNVnc+rl4GjM127CWmlIlMCrZfN1JTtNSjo1mYb7wYuJxBd9dz7CQ4fe1as8 zZHFM1oGWw8xy1R8L0I2ctpMbHIZ7WirrJ17AgNuyfmfCPdg+BrCuLv21uQDGA== From: Michael Walle To: u-boot@lists.denx.de Cc: Marek Vasut , Michael Walle Subject: [PATCH 2/3] pinctrl: get rid of some ifdeffery Date: Wed, 18 Jan 2023 13:12:23 +0100 Message-Id: <20230118121224.253241-2-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230118121224.253241-1-michael@walle.cc> References: <20230118121224.253241-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean Don't define an empty version for pinconfig_post_bind(). Just guard the call and let the linker garbage collection do the rest. This way, we also don't have to do any guesswork. Signed-off-by: Michael Walle --- drivers/pinctrl/pinctrl-uclass.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index 419ef5f52f..e6cd0889b0 100644 --- a/drivers/pinctrl/pinctrl-uclass.c +++ b/drivers/pinctrl/pinctrl-uclass.c @@ -20,7 +20,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if CONFIG_IS_ENABLED(PINCTRL_FULL) /** * pinctrl_config_one() - apply pinctrl settings for a single node * @@ -148,6 +147,7 @@ static int pinconfig_post_bind(struct udevice *dev) return 0; } +#if CONFIG_IS_ENABLED(PINCTRL_FULL) UCLASS_DRIVER(pinconfig) = { .id = UCLASS_PINCONFIG, #if CONFIG_IS_ENABLED(PINCONF_RECURSIVE) @@ -160,12 +160,6 @@ U_BOOT_DRIVER(pinconfig_generic) = { .name = "pinconfig", .id = UCLASS_PINCONFIG, }; - -#else -static int pinconfig_post_bind(struct udevice *dev) -{ - return 0; -} #endif static int @@ -411,12 +405,11 @@ static int __maybe_unused pinctrl_post_bind(struct udevice *dev) } /* - * If set_state callback is set, we assume this pinctrl driver is the - * full implementation. In this case, its child nodes should be bound - * so that peripheral devices can easily search in parent devices - * during later DT-parsing. + * If the pinctrl driver has the full implementation, its child nodes + * should be bound so that peripheral devices can easily search in + * parent devices during later DT-parsing. */ - if (ops->set_state) + if (CONFIG_IS_ENABLED(PINCTRL_FULL)) return pinconfig_post_bind(dev); return 0; -- 2.30.2