Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp68610lqk; Wed, 13 Mar 2024 16:57:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNbSddGXZCeBGvs0XT9B8ARBdfNrAWHiyOJA4uEn57VNzkQ0YICVojERSL8A4X5zZM65ezUOF2d817S4unm3BnluoJZ3YPh1R3YSn3OQ== X-Google-Smtp-Source: AGHT+IFBkb1h5QVE9bmgeJWTtkwA04iqSSbWshfAuxqfd55jAOod0ggiC+nTaMyY9kKwxTY2yTSr X-Received: by 2002:a05:6808:1718:b0:3c1:b7ce:1e1 with SMTP id bc24-20020a056808171800b003c1b7ce01e1mr308614oib.23.1710374221364; Wed, 13 Mar 2024 16:57:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710374221; cv=pass; d=google.com; s=arc-20160816; b=S0IbUbvxUVP5aTZSEcimj0w0Wv70L4X9HL/ezAy8El35bOeHvIXElm2zU+DLVAqWmk +2uOrttulicLH1EOz8ZrgnVSJafZpc4sQLCS/iC1YL4agyfThXCwArlA7diXQUwv7yAw rpZjGbIB/8Nl8yTgnqc7B90egzpdSpLtoighgagWbgL/umIi0nnBOcI42K5WuGEUwN2b ++XI2QFDngRNwkVDij73yxToC5BCj17lOh5Jt9hgCtfnNcFwUzoYx3IqgNo5S+D6WHI7 JriAydgFAZFgvOP5lQUButEbrrP6XW2PUi2X6zTCip0mSwDSQAn2jx/jTiQ0Sdf2Xvdd IVbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=pPNsUU+2eEp+XWgqijYcAFRbbdAyYtjvSGCmE4Dvj58=; fh=YgUZ2/lPRGLRG7A+awv03LUUmaPSy2eh3E767EmTYHs=; b=hlFq1zQpgtvWiNQoUn9vN8dzT30YMX9KPru4jAcnPBpE9fi2+C96vvKtBw1lYvSCBI JWTGZZhtCmhmC11HM7atiNiGfIM6Kn/GLslM/ERUxoNIlPzCUNPQ4jnVpiHHlZw2Zcfv +zNQfPRWYC5XfrSSgOt3IkcyHvuOzEns/FldECD34jaV2Pf7wQPezWiNa/UBtuF1n14F xX8T3pY1Usm2uMz/4kc8UMmE4kgBj8RWx58LxlZ93XT/aSViFNo2Nai2AVfheQ7J3OO8 o4ZzH+3IwT3aASWnRmGCMRJ8NRdPzB2S0ncpQ/cotSxVVw9uOkHDMWD5MpFM/Qo+RvD7 ciOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d8-20020a05622a15c800b0042e706a9ba4si253013qty.804.2024.03.13.16.57.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 16:57:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102663-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 071241C20A96 for ; Wed, 13 Mar 2024 23:57:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 230085E095; Wed, 13 Mar 2024 23:55:40 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E76B55D8E4 for ; Wed, 13 Mar 2024 23:55:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; cv=none; b=o+THMhSSShI79D2xtycKQv6/DzWCRllyh3NSJ54ZiIA55+Q5UFgMZPo+jxRNhCzNkFWpHeLWq982pspxEZAvgQUnt8RwW3698fHiYCeT3dm9uWLWbp7N5EcyZxYucDbc5a4UHeFiOpK8trDn/l0/NGen4hzn1lnNUbnjcIFMvIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374139; c=relaxed/simple; bh=k+1YhdyA6bA8FnqCXxwU7KWqjxoU2scZqrkAAb7HRG4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VjyacF/HbXj7Qc55DQ8GzprVCAp+qFbKWcwzMzeaEXoYUav2dWKd+KKJ/mUgR2L44JZ5zkl9fIw70f3e62POtESRZxg1C2jkMklTR4L/bnuBa0WCV8f7vtw4yYXJcMyEPb0Q0lwMtpqlGQSr/436EEPw9CYN83qkS1/M21jRtLU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 06688e94-e195-11ee-abf4-005056bdd08f; Thu, 14 Mar 2024 01:54:27 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 03/11] pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple() Date: Thu, 14 Mar 2024 01:52:06 +0200 Message-ID: <20240313235422.180075-4-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The ports are equivalent from the user's point of view. Don't limit trying them both if writing to one fails. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-aw9523.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c index 65d523697b731..d93640a02d1d3 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -653,7 +653,7 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *chip, struct aw9523 *awi = gpiochip_get_data(chip); u8 mask_lo, mask_hi, bits_lo, bits_hi; unsigned int reg; - int ret = 0; + int ret; mask_lo = *mask & U8_MAX; mask_hi = (*mask >> 8) & U8_MAX; @@ -663,10 +663,8 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *chip, bits_hi = (*bits >> 8) & U8_MAX; ret = regmap_write_bits(awi->regmap, reg, mask_hi, bits_hi); - if (ret) { + if (ret) dev_warn(awi->dev, "Cannot write port1 out level\n"); - goto out; - } } if (mask_lo) { reg = AW9523_REG_OUT_STATE(0); @@ -675,7 +673,6 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *chip, if (ret) dev_warn(awi->dev, "Cannot write port0 out level\n"); } -out: mutex_unlock(&awi->i2c_lock); } -- 2.44.0