Received: by 10.223.176.5 with SMTP id f5csp1919354wra; Thu, 8 Feb 2018 05:45:35 -0800 (PST) X-Google-Smtp-Source: AH8x224qWK500DxBjp+KTx7H0hCtICaFNtOQnU+NmmHsMqWmaJEQGe1w63np4aNQLLn1QNpL4F6s X-Received: by 2002:a17:902:507:: with SMTP id 7-v6mr719138plf.0.1518097535882; Thu, 08 Feb 2018 05:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518097535; cv=none; d=google.com; s=arc-20160816; b=jCq5bdd0J+HqtHxzocuHUzCCx6fh4g9f14qp4bu/AlDT7gc/tFY1OVq0I+CbIIUyOE APJoiFlQKKDSXrbnajbdBB0X+xwsh7qMA7MIK7dIPxIBNwek1oZS31akMSRYHniH9i/R ybdnZSfbmkP2jG2S8CBbwQFTRKrApf6SP2XZrum6lEXttPYyHRcBt2JqlOOHeJYHuf4R CK2PBNz9ej7IlSUklUufEHWwFdKjWn/3vOqlGxWGP+z8/eMir4aLsQENsn/jzHyOzezB ayyhbhyt8fSGfVA5HOuDxjYoZQeU/y2Cwlbhg2AgHmWqE1GLbqfZnC/cJAzG5dHtnceT LRXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=mD6phlS6jbNTC7zghvYb0HNv0KKzDvHSrMgrqc4Mydo=; b=B4e4Y9P4XrbREz6akN5c1kiINkc41YB8AjEdNKfgIWkB5HzMUGJIK382ezKUos9pnX CtweApDGU4fSlSIAfINNgWeWHkwUWWtKUipBT1A5LAxWH7uStrLeU4sh2j8JMlYS+bsK Sg8oKX0pPUk4jPHyOxUn8Bu6Br4Wu4Hr5rvZytOAAmGIiU6DtVE/VNVKUQ6/kVgMqU+S 7QEXgtsoqlU4QIJgTkqnjYUbdjT9Ds1F4yQl7FmZXt37mqtVjt4M35aGK87VhFs/rER/ U91AnU69KzlK0MOJRU/vwOXzl4FeHVUBJtxr1bSRZ1+RwKa+q9ZvDa6QWcrFOzuL6Szk ZkpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si2421198pgq.683.2018.02.08.05.45.21; Thu, 08 Feb 2018 05:45:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbeBHNny (ORCPT + 99 others); Thu, 8 Feb 2018 08:43:54 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:31460 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbeBHNnw (ORCPT ); Thu, 8 Feb 2018 08:43:52 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w18DcnRQ020814; Thu, 8 Feb 2018 14:43:26 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2fxmgps9g7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 08 Feb 2018 14:43:26 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CEEDD34; Thu, 8 Feb 2018 13:43:25 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B1EB05A33; Thu, 8 Feb 2018 13:43:25 +0000 (GMT) Received: from localhost (10.75.127.47) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 8 Feb 2018 14:43:25 +0100 From: Fabrice Gasnier To: , CC: , , , , Subject: [PATCH] regulator: stm32-vrefbuf: fix check on ready flag Date: Thu, 8 Feb 2018 14:43:05 +0100 Message-ID: <1518097385-7449-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG7NODE3.st.com (10.75.127.21) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-08_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org stm32_vrefbuf_enable() wrongly checks VRR bit: 0 stands for not ready, 1 for ready. It currently checks the opposite. This makes enable routine to exit immediately without waiting for ready flag. Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf") Signed-off-by: Fabrice Gasnier --- drivers/regulator/stm32-vrefbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c index 72c8b3e..e0a9c44 100644 --- a/drivers/regulator/stm32-vrefbuf.c +++ b/drivers/regulator/stm32-vrefbuf.c @@ -51,7 +51,7 @@ static int stm32_vrefbuf_enable(struct regulator_dev *rdev) * arbitrary timeout. */ ret = readl_poll_timeout(priv->base + STM32_VREFBUF_CSR, val, - !(val & STM32_VRR), 650, 10000); + val & STM32_VRR, 650, 10000); if (ret) { dev_err(&rdev->dev, "stm32 vrefbuf timed out!\n"); val = readl_relaxed(priv->base + STM32_VREFBUF_CSR); -- 1.9.1