From patchwork Wed Mar 27 09:58:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanley Chu X-Patchwork-Id: 10873161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96D7A17E0 for ; Wed, 27 Mar 2019 10:00:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B91E28923 for ; Wed, 27 Mar 2019 10:00:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F696289F7; Wed, 27 Mar 2019 10:00:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B581289F5 for ; Wed, 27 Mar 2019 10:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=LbGe6bwmiQg40AEsJi8kfz0DNWxwIDSoJQ+djls+fF0=; b=PaXicuvNM5mID2 4NipY9QHi1YmQgaen/tHbO7EhMU/gtb99XVQupv38gi8uNrhBeXyNIE5aiYm3HmEDrM/dN4pBFN3N dngO79vMxL7yWekmcUrliCnK8Jqm4u5oaoSMWUptcpv1jb2Qig4s8khstvFyFfFBi4zTbKtQUtlCK 00gAKiZsUxbn6nlCp8N2FEYZhm1bbGEcSX0bqU6lJyJWKaMaxQ2+GmHvug5S5yHNzU15TKmIZDhtZ 1wSXIwQJVh2rcMNRO/fXDG/LEo6RDSY4OAmSyaZPlGL4I3Q443jwsi6ygUPF0X9cKorSzmpVQjCms mo2ECzUIXhNghqzdt0qA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h95Ls-0001Yw-FR; Wed, 27 Mar 2019 10:00:08 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h95Lo-0000vP-9a for linux-mediatek@lists.infradead.org; Wed, 27 Mar 2019 10:00:06 +0000 X-UUID: f4f3a3a3f4bd4ff8b984672443d089e5-20190327 X-UUID: f4f3a3a3f4bd4ff8b984672443d089e5-20190327 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 881765319; Wed, 27 Mar 2019 01:58:52 -0800 Received: from MTKMBS02N1.mediatek.inc (172.21.101.77) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 02:58:50 -0700 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 17:58:43 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 27 Mar 2019 17:58:43 +0800 From: Stanley Chu To: , , , , Subject: [PATCH RESEND v3 4/5] scsi: ufs: Change "-max-microamp" to non-mandatory property Date: Wed, 27 Mar 2019 17:58:26 +0800 Message-ID: <1553680707-28579-5-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1553680707-28579-1-git-send-email-stanley.chu@mediatek.com> References: <1553680707-28579-1-git-send-email-stanley.chu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_030004_353987_4B899C22 X-CRM114-Status: GOOD ( 10.08 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.w.gonzalez@free.fr, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, matthias.bgg@gmail.com, Stanley Chu Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In dt-bindings for ufs, "-max-microamp" property indicates current limit and is mandatory if "-fixed-regulator" is not defined on a specified regulator. However, in some platforms, regulators without "-fixed-regulator" property may not need to define their current limit because they may want to define voltage range only for proper voltage switching in different power modes, especially for vcc, vccq or vccq2. Currently missing "-max-microamp" property in device tree will lead to initialization fail currently, thus such limitation shall be resolved to tolerate this kind of regulators. After resolving this, regulators without "-max-microamp" property will have undefined "max current" value, i.e., zero value in "max_uA" field in struct ufs_vreg. Because we do bypass current switching operation (by regulator_set_load) in case of undefined current limit, this patch shall be safe. Signed-off-by: Stanley Chu Reviewed-by: Avri Altman --- drivers/scsi/ufs/ufshcd-pltfrm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 32cf8c56f029..2420e6962219 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -157,11 +157,9 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, goto out; snprintf(prop_name, MAX_PROP_SIZE, "%s-max-microamp", name); - ret = of_property_read_u32(np, prop_name, &vreg->max_uA); - if (ret) { - dev_err(dev, "%s: unable to find %s err %d\n", - __func__, prop_name, ret); - goto out; + if (of_property_read_u32(np, prop_name, &vreg->max_uA)) { + dev_info(dev, "%s: unable to find %s\n", __func__, prop_name); + vreg->max_uA = 0; } if (!strcmp(name, "vcc")) {