From patchwork Fri Nov 13 15:21:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11903933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14D4FC55ABD for ; Fri, 13 Nov 2020 15:22:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97F2921D7F for ; Fri, 13 Nov 2020 15:22:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GNm8iPWq"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="TkjknRPn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97F2921D7F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IseH0eIhvo2nLDp2EAjZbcySI+h6N5RxHJ8bsMSgkiQ=; b=GNm8iPWqFKHQfYb8rwBLHhI3n g5AbtELJUVmr5iMicNGwoEPJ6+OGUf1rIYhYxOyQHDdzlbLh0IskLgkgUmdxAvY38KEOhquaY7TBp jQ8dqrtol/Yq9M6yS3HLCWLk/n5F3yBas0DdFyuyW6PgU3/JsjuGJlr3hCdE0CIHAqgXQCwLto37g WVoReUzajiMKO0xqTpHNLIYkywvChsDCIcjEgx9PDqUYvxQYUcuBJ2CaGtxAd+0pIt0w2eoswgOwQ bKMrapkYJXrgXJosJomGJ1JxjfA386LbdD413ZM+BkvcRqrGyw+b6NKzp/M97jqOxb4Krs5jn3wpY 9RyLUe5vg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdatV-0001Y5-0g; Fri, 13 Nov 2020 15:21:45 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdatD-0001P1-Lk for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 15:21:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1605280888; x=1636816888; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=qi4ydAI8o4oJpJGd7zvYmGVBebnhYeEm03dyN/oO0L4=; b=TkjknRPnEPZMkNTSDkloq2IcVMqJ7IM9D6MuEMclZogl76RPVDl4gHqy HS+d1RUxIgrneZPiGhNGUFKoM+cJu7xXR1k0Yqgd/aAmBPgqACO3CeF7B TkIxXPGNW3kZ7D+1Lajz6h8B9qccSSamMgrc9rgE4MxWMJoXOspbCfTyy 1bKYTAtEIYEdvoQcRgabTuOPidLdSBG1ZhjpC12i6cVfGHvXWXJdWP6av KBT4zN85SnAsJP7MkbbmBg8obt2jKKrUk9Koc7Jz7Fm1dgiKagtimhEj1 A0ymS7UiaRlYci2SYoFS7iY996y9CpTUNemz5is6aFvQIj+k+SVTatHI7 g==; IronPort-SDR: VML+9dKlH/GH/6LP1kBWoT7nnsc2ZvvbqZEPi7gs6QQf+q7ff11+BSeaFXkmhXZCAprqlVpCcT raC5PY3Ynr1cU1m6T2bYouPi+J/7+f1D0PA5QTB7ExR5KLnQZjdIHPSqG4c4q3IS9oFWcSzok7 zY7Lbp70vTD0qoXCdu3StobCGgvqnTKcFie4KNuc9jtvSRe+vRHZgi4vRWge/7y72lWBtBjkVa g47i4Q+IeqJtXr189IldXvlYFVGjQfBejkEPQcYFcB+WvQNqr26+JePiFNkabASUyoYGBSfosm 3dc= X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="98340454" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Nov 2020 08:21:28 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 13 Nov 2020 08:21:26 -0700 Received: from m18063-ThinkPad-T460p.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Fri, 13 Nov 2020 08:21:22 -0700 From: Claudiu Beznea To: , Subject: [PATCH v3 2/6] regulator: core: do not continue if selector match Date: Fri, 13 Nov 2020 17:21:06 +0200 Message-ID: <1605280870-32432-3-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1605280870-32432-1-git-send-email-claudiu.beznea@microchip.com> References: <1605280870-32432-1-git-send-email-claudiu.beznea@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_102128_404129_E14EBD66 X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: axel.lin@ingics.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, Claudiu Beznea , ttynkkynen@nvidia.com, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Do not continue if selector has already been located. Signed-off-by: Claudiu Beznea --- drivers/regulator/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 1d0d35f14f37..6724324d372c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4037,6 +4037,9 @@ int regulator_set_voltage_time(struct regulator *regulator, if (i < rdev->desc->linear_min_sel) continue; + if (old_sel >= 0 && new_sel >= 0) + break; + voltage = regulator_list_voltage(regulator, i); if (voltage < 0) return -EINVAL;