From patchwork Mon Aug 26 09:53:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13777555 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 20E96C5321D for ; Mon, 26 Aug 2024 09:55:31 +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=ntdGs4vuSooBAzvCHrAxlUgrp5xxEcym7Lh67cUpkGo=; b=lMUimoSseyAJ6WZ8PGoVCclXAl BUAePMNVLgBfc0ornFuwPfjcimEAVPSMmTm1LNq79J2VYLbbjt+YWH9s8m4X0QcW1C2D+n0oJYzan z5xlywf0ZMQc5MCYoaHC9HiNs8Lg9OmAj1c6/SxoScaxYWbAmkCBxOhKSIaPspz/GQdqlO99i1Fh7 +71SPn01nI969Jd9hvujnWAxae8y+rapk3D0rBsVSKRPaMB3HoRg2dqgO/Bn/2AJAfLtlSN+bfxij MGCsn6DxJ97KdPak+l+0vgyeBezyRLjHAsR9U5y4jHMqINzMtlj+Vgd8mQSJF2RNNjZvoyadGkXL4 IhIl6e4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWRW-00000006nWu-2xMc; Mon, 26 Aug 2024 09:55:22 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWPR-00000006mtQ-1NAT for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 09:53:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724665993; x=1756201993; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FM0aUTLDtyB6gqzlabbXPTBd7yBelmI/W35+tx3U+aE=; b=Cs8pqdxK2L4pDy/WyF0ficHi0yEK1oW8kIHDjMT5pgPUXj63UmWwRbQQ hI0YJm+xEZsoxJgRQnXe3aNpg1Vu9L/izrMyAfigvqx5KiofCwKYvMmff MT8wHIfXjSDYEFOXIdnv2mmK0NDUB9/7y5eozScd6e1ldZi+MGVtLe3Pf 0Q7DKj2fas0FHSnHf0HfSpunbT9/VzrDy1L9yYJE7hzMRM3VK2Hg/49A1 sZeUOB9mqWojjCPDjlRqsTXdDjItiM5hxduHMyomV4ggutAqId1o7RKd8 +5dWOkl9NbafPn/2yikWPXEqcoHJpUgeNX+GK4u5VCJUa7o4cHVO2zBGc A==; X-CSE-ConnectionGUID: XvrfShrwTxqJlZqJy5gxMg== X-CSE-MsgGUID: VFiLoG+ZQg6Hai3ll7f5DQ== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="40548502" X-IronPort-AV: E=Sophos;i="6.10,177,1719903600"; d="scan'208";a="40548502" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2024 02:53:11 -0700 X-CSE-ConnectionGUID: rUaLih7UTVWeA32VhCL20Q== X-CSE-MsgGUID: U5e3Kgi+S5SFPDGvTftcMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,177,1719903600"; d="scan'208";a="62295820" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 26 Aug 2024 02:53:09 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7715A502; Mon, 26 Aug 2024 12:53:07 +0300 (EEST) From: Andy Shevchenko To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Maxime Coquelin , Alexandre Torgue , Andy Shevchenko Subject: [PATCH v1 1/1] pinctrl: stmfx: Use string_choices API instead of ternary operator Date: Mon, 26 Aug 2024 12:53:06 +0300 Message-ID: <20240826095306.1420628-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_025313_482933_105C9828 X-CRM114-Status: GOOD ( 10.97 ) 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/pinctrl-stmfx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index 6313be370eb7..d2c5321dd025 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -369,14 +370,14 @@ static void stmfx_pinconf_dbg_show(struct pinctrl_dev *pctldev, return; if (dir == GPIO_LINE_DIRECTION_OUT) { - seq_printf(s, "output %s ", val ? "high" : "low"); + seq_printf(s, "output %s ", str_high_low(val)); if (type) seq_printf(s, "open drain %s internal pull-up ", pupd ? "with" : "without"); else seq_puts(s, "push pull no pull "); } else { - seq_printf(s, "input %s ", val ? "high" : "low"); + seq_printf(s, "input %s ", str_high_low(val)); if (type) seq_printf(s, "with internal pull-%s ", pupd ? "up" : "down");