From mboxrd@z Thu Jan 1 00:00:00 1970 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 785C7C19F2B for ; Thu, 4 Aug 2022 10:42:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9174684534; Thu, 4 Aug 2022 12:42:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="bLNnKUKM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4462084821; Thu, 4 Aug 2022 12:42:23 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 61A7584821 for ; Thu, 4 Aug 2022 12:42:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0854D616A0; Thu, 4 Aug 2022 10:42:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 417C8C433D6; Thu, 4 Aug 2022 10:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659609738; bh=9GhQQxfYKBzFVm/5wwEPvFDn6FwoZbYF8FJWhwCLzO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bLNnKUKMZfxn4B1KgDXAK4XEHwUklIPB0f6Ba6Jg5oPxDdex1NxGGO7iWOlPceVsX JYwDBLxs7LzZO+AKzAkpHO+YZ3pLREgEWNJn2PTwT795sdVfriuZaeYfzDZI68bfR4 Vq51v6l4fQEsKWlZE+lbL1OQm76rJJ3sGRkQfVjNWNsjH2+Y+LXalDAmm9+NDO1+x8 Apx6VmR7TSQ1gvNOPEbb/Gz6m7mY+93ZemTGCC1M6C9clQgA6b5UPXFxAS7BDGoTLB MTUJoSOGG/7xVxL6Tps01LgmbGuZFP0xr35846xb5WPBbn8nMDQCCdULtFRa/QBdcD e/NX1nOOwYtCg== Received: by pali.im (Postfix) id B3D08B01; Thu, 4 Aug 2022 12:42:15 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese Cc: =?UTF-8?q?Marek=20Beh=C3=BAn?= , u-boot@lists.denx.de Subject: [PATCH u-boot-marvell 3/3] arm64: a37xx: pinctrl: Improve description for pinmux command Date: Thu, 4 Aug 2022 12:41:56 +0200 Message-Id: <20220804104156.22209-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220804104156.22209-1-pali@kernel.org> References: <20220804104156.22209-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 In more cases group name consist of function name followed by function number. So if function name is just prefix of group name, show group name. So in 'pinmux status -a' command output would be visible also extended function number, which is useful for debugging. Signed-off-by: Pali Rohár --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 32b49f167c66..25fbe39abd19 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -406,7 +406,17 @@ static int armada_37xx_pmx_get_pin_muxing(struct udevice *dev, unsigned int sele for (f = 0; f < NB_FUNCS && grp->funcs[f]; f++) { if (grp->val[f] == val) { - strlcpy(buf, grp->funcs[f], size); + /* + * In more cases group name consist of + * function name followed by function + * number. So if function name is just + * prefix of group name, show group name. + */ + if (strncmp(grp->name, grp->funcs[f], + strlen(grp->funcs[f])) == 0) + strlcpy(buf, grp->name, size); + else + strlcpy(buf, grp->funcs[f], size); return 0; } } -- 2.20.1