Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp990684lqh; Fri, 29 Mar 2024 03:57:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUq+hFmGa0AraSx22gsKuCovYLL/3QmJk/61Vsd9s9W+jrSYvz3mi0pCPJoURMkud8yXatNcm619CSMZm9Z0VqEgNxhfdewQuK0NbAMrQ== X-Google-Smtp-Source: AGHT+IGOngPB2HAg0BIHO87veUltvct8vle+/TGTd9toYECRzSwz3zZSMIwl0tEP7MGKgXwCuQVY X-Received: by 2002:a05:6358:7594:b0:176:99f3:8d11 with SMTP id x20-20020a056358759400b0017699f38d11mr1588703rwf.32.1711709860969; Fri, 29 Mar 2024 03:57:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711709860; cv=pass; d=google.com; s=arc-20160816; b=YZ3IAwLar0d7FClvCf4aG7Gkw6g8p12a1Yl4+khBgsdGbinRrAFgrERKavyzQVj7Rs XqmIRociEEqGSwUjR0MM5QBCCgc5isybQVDSUEXikLm+XokXf6Qlz8nPn2I+FWcvgfuy 5vMR0pm+H+NMB1LZswJ4qCDe2E0VKZE9VZ/sDfKw3xcLHST3yOaha4w7MMWgvNokRfHH WnqSrpZoaSL4pDfahywD9+eTh4KOflYoxaJ//TGKdoHx75UBMF7rtoiBan+Op5QCSycs zmWhUXrMf2zSSvKpqowweuhaA0veFLgeSwLODxUPe4e8glLZ+ys54lod2pmENeuk6JIQ AyJg== 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=vWNc7Tqw2Xx6H4MWdrUFPG0kISbSv+DG+GBhUG7d0I/1NlvIwiXKvYbPRsoSIFRvbJ F5JH91I+KI7MFwSnsLZfPCIjSEcSXU7wSr2/mV9q60DH4fe52iaLKgSmR8yqDcuXcZGd KUJDoE5TwDM+MKVXMu/2C7Oq7tODetWOwqBqvMqGogj/d3UyNpVuU1B0pUG74ieupSei FjEb+VZx+OWgQUJsLKLTIjXo8sJA22gmZ7PhS7STNtVj4eNw/IdtSJHd1e/qGg2Vpcyh fu9cFlzAvaOGU1h1O0XU1dEgrDhtZlkYkLpuE7CQ60/Hky3cWh2/1Fres7ST3bqZ5ggN +pnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-124411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124411-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b9-20020a631b49000000b005dc4a79c282si3294222pgm.530.2024.03.29.03.57.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 03:57:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-124411-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124411-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9B53D287BC3 for ; Fri, 29 Mar 2024 10:57:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 097DD7CF21; Fri, 29 Mar 2024 10:56:50 +0000 (UTC) Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 760476A8CF for ; Fri, 29 Mar 2024 10:56:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709809; cv=none; b=D+NHwr3OinLWGPXr98b58xFKoLyq4cllW6gdJTyojKEypfvNSxFSLhWrFU0a2WEJtbV9Zcv+5yyJNhPHTg1jn9vR9ZVVrrknD8ZWpFdvSA2TxxzjaCtlqAjIWgwaMe+DvKTfIYHYV0l9bqeBHZeKPcjRS/gKmpxBzhp+FEDg/qY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711709809; c=relaxed/simple; bh=k+1YhdyA6bA8FnqCXxwU7KWqjxoU2scZqrkAAb7HRG4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eupVIsdUFvPlpYlue511o5Zjx05X8jsZeDLGvOIfY2VXIWIxlJaOpJcGecWiwlPJaMwHbUhlKJAW+QYeKoHV88elmghooQa6FhFyZ4JW9bXjM4D4dPSSAwbLJ1WpEwfTVkdhYp7xwikCsHyTEG5WHjli01JK1UPS2BNWJ/yl1HA= 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.84 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 fgw23.mail.saunalahti.fi (Halon) with ESMTP id 04ffcd06-edbb-11ee-b972-005056bdfda7; Fri, 29 Mar 2024 12:56:39 +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 v2 03/11] pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple() Date: Fri, 29 Mar 2024 12:55:17 +0200 Message-ID: <20240329105634.712457-4-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240329105634.712457-1-andy.shevchenko@gmail.com> References: <20240329105634.712457-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