From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH 3/3] mmc: sdhci: check voltage range only on regulators aware of voltage value Date: Wed, 5 Dec 2012 10:48:25 +0900 Message-ID: <20121205014823.GA28474@opensource.wolfsonmicro.com> References: <1354629663-29091-1-git-send-email-m.szyprowski@samsung.com> <1354629663-29091-4-git-send-email-m.szyprowski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from opensource.wolfsonmicro.com ([80.75.67.52]:58694 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752000Ab2LEBsd (ORCPT ); Tue, 4 Dec 2012 20:48:33 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Kevin Liu Cc: Marek Szyprowski , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Kyungmin Park , Liam Girdwood , Chris Ball On Tue, Dec 04, 2012 at 10:50:03PM +0800, Kevin Liu wrote: > 2012/12/4 Marek Szyprowski : > > + if (host->vmmc && regulator_get_voltage(host->vmmc) > 0) { > > ret = regulator_is_supported_voltage(host->vmmc, 2700000, > > 3600000); > > if ((ret <= 0) || (!(caps[0] & SDHCI_CAN_VDD_330))) > Good idea. But how about the regulator is disabled at this point? So I > suggest to change to > if (host->vmmc && regulator_get_voltage(host->vmmc) >= 0) I'd not expect regulator_get_voltage() to return 0 for disabled regulators, I'd expect it to return the voltage the regulator will have when enabled.