From patchwork Mon Aug 26 09:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13777557 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65DEBC5321E for ; Mon, 26 Aug 2024 09:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=tTC9V+sOEQKOxd3dNX2hA+MKfjmPjGCQfIeVVWta0Vs=; b=C7ctfRcyXw8iYnjwMXNp5QQETI 9jehLG4o4KrcG4DVUC4HcZNnYA19FkZZJ3vJMp4GN1nFrz5GFKsiLY74gSmt19N2zIPpe43CSVJFx 0vjxTfKuxi+BduqkSAZ+XoSKqLTV8QLk1tfIL7DKjVD3ocJ+gKtfkeapXtwLFJTxv+IZe/YPNhIPf W7Y0hmevnqnkPPzeF7fhJzZ4418n+QMUdGTacENa1mPG2v9T31RDQ2SIHqZ3/kuAx8dhiml8dfDAJ 6cupJM6us8I8A65NS/8T+EcRjZTxqNNuKn90X5cc1cK5/QQQaUIb0rB+Oi4TciPVNTta+TVi2BlQg kpbQbZ9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWUN-00000006o45-3vsE; Mon, 26 Aug 2024 09:58:20 +0000 Received: from mgamail.intel.com ([198.175.65.17]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWTY-00000006npo-0ket for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 09:57:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724666248; x=1756202248; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KEMMQDtGNxlzkDadYBGaL1mVngh6rKo9Hls0idoSS2M=; b=c20exh8UFAumXnLAeEjg6vkDD/StzwSFr4cOXSP6gMSiMuVcB+JkMISk DVacj7BTqe9hZ4q5WqL+yK9OThpqAQn4GYp73Sn2iTvboZZpmsMbA46J4 xcZhkXMJ5l/kMYsmhUUMs0XDH/a1xGJyKguWlCoHoAmlpzWzeo8LLHl3u PgY+kxvOJ+Ued+hRcfjwPAgcfBrOFL+hpkdicAntqs3bhlBnELEL4jiYU ffc688C6JXPzSRAm2MiPOdoceyBHIWTkIgcYHlE6I21JPIJAnk8zBCrdD bAZ88w+HSlOGp2/oGrGE03uYL5jp5bSbhGVyiP9iNgXAG/gK5NdG6JstJ A==; X-CSE-ConnectionGUID: BwG+3Z1yROeDf8wBegyfRA== X-CSE-MsgGUID: 10X0xNW7T4OzLih7wEqJeA== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="23259026" X-IronPort-AV: E=Sophos;i="6.10,177,1719903600"; d="scan'208";a="23259026" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 02:57:27 -0700 X-CSE-ConnectionGUID: ibd0HonmTjKkmk3k18WkGQ== X-CSE-MsgGUID: xGAhSbUSQz241oRUmdEckw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,177,1719903600"; d="scan'208";a="67388644" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 26 Aug 2024 02:57:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2D224502; Mon, 26 Aug 2024 12:57:24 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , =?utf-8?q?Th=C3=A9o_Lebrun?= , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/1] pinctrl: nomadik: Use string_choices API instead of ternary operator Date: Mon, 26 Aug 2024 12:57:23 +0300 Message-ID: <20240826095723.1421065-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_025728_308147_BE6C5ECB X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use modern string_choices API instead of manually determining the output using ternary operator. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index fa78d5ecc685..9cc64547730a 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -28,6 +28,7 @@ #include #include #include +#include #include /* Since we request GPIOs from ourself */ @@ -1105,17 +1106,16 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin, "pin %d: sleep pull %s, dir %s, val %s\n", pin, slpm_pull ? pullnames[pull] : "same", - slpm_output ? (output ? "output" : "input") - : "same", - slpm_val ? (val ? "high" : "low") : "same"); + slpm_output ? (output ? "output" : "input") : "same", + slpm_val ? str_high_low(val) : "same"); } dev_dbg(nmk_chip->chip.parent, "pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n", pin, cfg, pullnames[pull], slpmnames[slpm], output ? "output " : "input", - output ? (val ? "high" : "low") : "", - lowemi ? "on" : "off"); + output ? str_high_low(val) : "", + str_on_off(lowemi)); clk_enable(nmk_chip->clk); if (gpiomode)