From patchwork Fri Nov 13 17:56:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 11904391 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 03398C388F7 for ; Fri, 13 Nov 2020 17:56:43 +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 7E28D208D5 for ; Fri, 13 Nov 2020 17:56:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oc4IPzQk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="KHNPDqXZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E28D208D5 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: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:In-Reply-To:References:List-Owner; bh=0fPNagTqKwXbmBZRlhXme8xtxtDBLm/mkOTQpWqlkko=; b=oc4IPzQkL16o0b2UtjO434Vd3J LQDBpNAui8K/LehsyaFWINdlXq+VkoJjnkRTxhopI4hzOZkwk/yppqgE+QHhJeiOybPQfLXMicakm SCaldZ2QQrIRvg8jZKcu5p32YVvNx3w6KGhx4NO5l3d3Tlu6GvOehXDja5jW9ehllogVDLjU9rbbb VQud0OLjQjwiImaZAIKJtLD9WKhsaSDHoPuiOfUr/xtF/bEKu2uOLsHDbkNJz3wTuV8L3gwaBSvU4 iJ6g1t7TiPCyTmxyKbjl1cm8QoVvvVCLLur2FBOVKtD9bvN+/dpxQzyg4M27x19aXWw+ppn08+Ny/ gMB18u9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kddJ2-00080X-U1; Fri, 13 Nov 2020 17:56:16 +0000 Received: from esa4.microchip.iphmx.com ([68.232.154.123]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kddJ0-0007zS-DY for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2020 17:56:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1605290174; x=1636826174; h=from:to:cc:subject:date:message-id:mime-version; bh=hi/EXWbkj8b1GwYopAr3TMpnILzgZhmOpGToZR+VA+w=; b=KHNPDqXZVtYYWRc0aVz1HQb55yY6KqPE8vwr/wY/G5ntGAW0P0tsDleM AQ1TDnySmMo+hGnThfMNiAfQ4HKADcFE9JN5FFqMikHcFnK4/9ex5B2Je lt5KtFMczS3ENqC5qYuaNeWT+1OqwwOw4ns4ggbuMc4zhFizDTbT6M777 /dZUF9BSZ7Sd9OqRvUgnhNVsBX723Bd89hx+rE5sc2lI42c2TFO4gCpTa pwF2pASKrcvg75Q7PbTKTNBQ8M+uj2uMrOySHSyPBv2FRp1D2/ncEu4oD /nztTJF4edDtMthrFp9CXrc1wL7Mk26e6bt0Tnv6Xlq8qnlvkC1I4Vucz A==; IronPort-SDR: ITcZRXMHZRkgZlHPlLtPBUCmGzpAtfF+P/cOQZJWanCy1T92v0PmJrFgjpak3IeeNzqlqDEPgJ Vt4mCyR/v4qa6wPT5uN85RRbiE2bBLnh/MwgMGYyKPVTCbAxAgPmbRfGoORfAXBay1MhnYme57 9AAJBj9aTi4vPwN6rFs5dTGJSqjjTl8a0xKADoc2YvKVSJLXLQLxSncAoBYZgnRoyyPts8LmhK U7gauSwqZss8SdR0tf1YP/taK5zHYUdEVNfL9j9z49BZxvqYC1pyfkzaOPGrSV93wdH2xJmSvP 1t8= X-IronPort-AV: E=Sophos;i="5.77,476,1596524400"; d="scan'208";a="93573092" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Nov 2020 10:56:10 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) 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 10:56:10 -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 10:56:07 -0700 From: Claudiu Beznea To: , Subject: [PATCH v4 1/1] regulator: core: do not continue if selector match Date: Fri, 13 Nov 2020 19:56:04 +0200 Message-ID: <1605290164-11556-1-git-send-email-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201113_125614_591461_BCDC77D6 X-CRM114-Status: GOOD ( 11.55 ) 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Claudiu Beznea 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 --- Changes in v4: - this was part of patch series with title "regulator: mcp16502: add support for ramp delay" -> keep only this patch in series as the rest were applied - rebased on top of current regulator/for-next drivers/regulator/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index f0da0053579c..216b0cbce199 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4035,6 +4035,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;