From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754093AbdBDKtB (ORCPT ); Sat, 4 Feb 2017 05:49:01 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:35224 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbdBDKsR (ORCPT ); Sat, 4 Feb 2017 05:48:17 -0500 From: Mark Brown To: Dmitry Torokhov Cc: Mark Brown , Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org, Bjorn Andersson , linux-kernel@vger.kernel.org In-Reply-To: <20170203231619.8013-2-dmitry.torokhov@gmail.com> Message-Id: Date: Sat, 04 Feb 2017 11:48:07 +0100 X-SA-Exim-Connect-IP: 2001:67c:1810:f051:e387:5dab:49ba:da3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Applied "regulator: core: simplify regulator_bulk_force_disable()" to the regulator tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch regulator: core: simplify regulator_bulk_force_disable() has been applied to the regulator tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >>From b8c77ff6902baa6ca93ca643bfff2d565801ea30 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Feb 2017 15:16:17 -0800 Subject: [PATCH] regulator: core: simplify regulator_bulk_force_disable() There is no need to have two loops there, we can store error for subsequent reporting. Signed-off-by: Dmitry Torokhov Signed-off-by: Mark Brown --- drivers/regulator/core.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 206c274c0003..fe05923611ee 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3687,21 +3687,17 @@ int regulator_bulk_force_disable(int num_consumers, struct regulator_bulk_data *consumers) { int i; - int ret; + int ret = 0; - for (i = 0; i < num_consumers; i++) + for (i = 0; i < num_consumers; i++) { consumers[i].ret = regulator_force_disable(consumers[i].consumer); - for (i = 0; i < num_consumers; i++) { - if (consumers[i].ret != 0) { + /* Store first error for reporting */ + if (consumers[i].ret && !ret) ret = consumers[i].ret; - goto out; - } } - return 0; -out: return ret; } EXPORT_SYMBOL_GPL(regulator_bulk_force_disable); -- 2.11.0