Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp676358rdb; Mon, 29 Jan 2024 14:55:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdRSwYCHA6MYqEbSr6W0MLOLysI5e5ID5sUbWAfAz5e6Z1SFADSBe7yFMWHqCqzNybbDKO X-Received: by 2002:a05:6a00:1d15:b0:6db:c9f4:cec1 with SMTP id a21-20020a056a001d1500b006dbc9f4cec1mr3681878pfx.22.1706568929035; Mon, 29 Jan 2024 14:55:29 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z30-20020a056a001d9e00b006d61376e49csi6544726pfw.93.2024.01.29.14.55.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 14:55:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@kernel.org header.s=k20201202 header.b=pK0cD4MA; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-43591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CEC56B207EF for ; Mon, 29 Jan 2024 22:54:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A20F651C5A; Mon, 29 Jan 2024 22:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pK0cD4MA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9AB0D50A60; Mon, 29 Jan 2024 22:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706568850; cv=none; b=HKLoqNunnRFGByOh5WdOJXAVhbZak/G5rhqUA9YlGU2zrIwMVN/vPiv/GFn9k2XUVpJvrY4Vaiq2+YCZcsfTDfwj23XGm2zWhoAkrJKCtrk9INf6tKP3JzHrIMO+9mjQWgdi5siPbF26hl1vxSP3zEwqHisIwx4YJgZh7TX59ws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706568850; c=relaxed/simple; bh=FFstQCaEVYebwCAk5V39FByioEwYLF/w48Zz+jZSaII=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=R3eND1V3kmy/iUp7PY/2rum+QqZycOZ0V2dh0Z7ovKfzxnyq5zXSDsanXGzxWHRcGZkN9pK+H7nvlsUe3xa0HmZ/wtsmzIFjTVZDUNn+5TK3USMOHhZaY72c1WgBRQdD5+XEITai+ap4DEyrkQP7tY9IosbD17twIlvNWIT0SlI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pK0cD4MA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B11EC433C7; Mon, 29 Jan 2024 22:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706568850; bh=FFstQCaEVYebwCAk5V39FByioEwYLF/w48Zz+jZSaII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pK0cD4MADvaFzA0ck6IPeG52COc8b/urvJi/DKU2XRlElEZ9KresXMpci4SWXtIYi CsjFjzqYZlDBhCJKWSeDpKsHtticcP8LuNVybQYdT9HxLQd/h6QuO1H1/4pCyqTDQ/ gmXLjVBvr4E9gsYzpxOpRmcFlEvfgVz3RWf9mhbz9CQ7+BqFOcLtcfb8QCgZkcGyxU ZhfRWt7MiVh5puFO9IFA9U4VzQLkYp6WGLaIfuEgDDhduw6u80kXt6OUmuJPNDZsBx llVsLkgI82ECXkZA0NsQPC/ddz8bGPgR5oh29AMmfuQdHLCxx9rCDHNg3W2pvsSmrB WNzItk1Hv+eIA== Date: Mon, 29 Jan 2024 23:54:03 +0100 From: Andi Shyti To: Thomas Richard Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Tom Joseph , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com Subject: Re: [PATCH v2 04/15] mux: add mux_chip_resume() function Message-ID: References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> <20240102-j7200-pcie-s2r-v2-4-8e4f7d228ec2@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240102-j7200-pcie-s2r-v2-4-8e4f7d228ec2@bootlin.com> Hi Thomas, .. > +/** > + * mux_chip_resume() - restores the mux-chip state > + * @mux_chip: The mux-chip to resume. > + * > + * Restores the mux-chip state. > + * > + * Return: Zero on success or a negative errno on error. > + */ > +int mux_chip_resume(struct mux_chip *mux_chip) > +{ > + int ret, i; you could put this 'ret' in the innermost indentation part, which here is inside the 'if (...)' (or inside the 'for (...)' if you follow Andy's suggestion). Andi > + for (i = 0; i < mux_chip->controllers; ++i) { > + struct mux_control *mux = &mux_chip->mux[i]; > + > + if (mux->cached_state != MUX_CACHE_UNKNOWN) { > + ret = mux_control_set(mux, mux->cached_state); > + if (ret < 0) { > + dev_err(&mux_chip->dev, "unable to restore state\n"); > + return ret; > + } > + } > + } > + return 0; > +} > +EXPORT_SYMBOL_GPL(mux_chip_resume);