From patchwork Tue Dec 4 14:01:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 1837671 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 97C663FC64 for ; Tue, 4 Dec 2012 14:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990Ab2LDOBj (ORCPT ); Tue, 4 Dec 2012 09:01:39 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:13802 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754073Ab2LDOBh (ORCPT ); Tue, 4 Dec 2012 09:01:37 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEI00AQQEXVRBM0@mailout3.samsung.com>; Tue, 04 Dec 2012 23:01:35 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-d2-50be023f2388 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E9.1F.12699.F320EB05; Tue, 04 Dec 2012 23:01:35 +0900 (KST) Received: from localhost.localdomain ([106.116.147.30]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEI00EMKEY4BV70@mmp2.samsung.com>; Tue, 04 Dec 2012 23:01:35 +0900 (KST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Cc: Marek Szyprowski , Kyungmin Park , Mark Brown , Liam Girdwood , Chris Ball , Kevin Liu Subject: [PATCH 2/3] mmc: use regulator_can_change_voltage() instead of regulator_count_voltages() hacks Date: Tue, 04 Dec 2012 15:01:02 +0100 Message-id: <1354629663-29091-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1354629663-29091-1-git-send-email-m.szyprowski@samsung.com> References: <1354629663-29091-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJMWRmVeSWpSXmKPExsVy+t9jQV17pn0BBu/vGVtc3jWHzeLI/35G ByaPz5vkAhijuGxSUnMyy1KL9O0SuDL+LNnFXHCSo2L6n93MDYwT2bsYOTkkBEwkzh3fzQxh i0lcuLeerYuRi0NIYDqjRP/HdSwQTjuTxKo1U1hBqtgEDCW63nYBVXFwiAhYS+xd6AtSwyzw llFi+a3tLCA1wgJZEncOHWUEsVkEVCWuTZrOBGLzCnhIfGieywjSKyGgIDFnkg2IySngKfH2 J1i1EFDFveXrGCcw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJEez5Z9I7GFc1WBxi FOBgVOLhXfBiT4AQa2JZcWXuIUYJDmYlEV6FD3sDhHhTEiurUovy44tKc1KLDzFKc7AoifM2 e6QECAmkJ5akZqemFqQWwWSZODilGhh1j0zbbHrptsGTi8vPfdi9gCdh+hYDJo2N4uwGcpnX jD6/uO1129zIYkLZ/5j55a2loZ5+d6/6qXVxOTx9U3n3QMErNk7ubfZHSitfqL1W/XOmryDn k0/Yes9H5Uru2wysn9S6GLw/W/f06K7GPZNeVn1WSUwolDReVdA+TUhsZ3sQz/T1fg+VWIoz Eg21mIuKEwFTe3k0+AEAAA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org mmc_regulator_set_ocr() depends on the ability of regulator to change the voltage value. When regulator cannot change its voltage output, some code is skipped to avoid reporting false errors on some boards, which use MMC hosts with fixed regulators (example: Samsung Goni and UniversalC210 boards). This patch replaces a hacky workaround based on regulator_count_voltages() value with the correct call to recently introduced regulator_can_change_voltage() function in regulators core. Signed-off-by: Marek Szyprowski --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index aaed768..f5a0493 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1137,7 +1137,7 @@ int mmc_regulator_set_ocr(struct mmc_host *mmc, */ voltage = regulator_get_voltage(supply); - if (regulator_count_voltages(supply) == 1) + if (!regulator_can_change_voltage(supply)) min_uV = max_uV = voltage; if (voltage < 0)