From patchwork Mon Nov 5 13:11:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Ball X-Patchwork-Id: 1697001 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5B062E0010 for ; Mon, 5 Nov 2012 13:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932101Ab2KENLV (ORCPT ); Mon, 5 Nov 2012 08:11:21 -0500 Received: from void.printf.net ([89.145.121.20]:57873 "EHLO void.printf.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754038Ab2KENLS (ORCPT ); Mon, 5 Nov 2012 08:11:18 -0500 Received: from c-76-24-28-220.hsd1.ma.comcast.net ([76.24.28.220] helo=octavius.laptop.org) by void.printf.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1TVMSO-0005en-BQ; Mon, 05 Nov 2012 13:11:12 +0000 From: Chris Ball To: Philip Rakity Cc: Daniel Drake , Johan Rudholm , "linux-mmc\@vger.kernel.org" Subject: Re: UHS-I voltage switching on OLPC XO-1.75 References: <10400F30-0A08-4B95-9C62-018A3AD4068B@nvidia.com> Date: Mon, 05 Nov 2012 08:11:09 -0500 In-Reply-To: <10400F30-0A08-4B95-9C62-018A3AD4068B@nvidia.com> (Philip Rakity's message of "Mon, 5 Nov 2012 13:49:43 +0100") Message-ID: <87hap4b3f6.fsf@octavius.laptop.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Hi, On Mon, Nov 05 2012, Philip Rakity wrote: > Hi Daneil, Chris, > > I reviewed kevin's patch in September which fixes this issue. Chris > -- can we pull it into mmc-next ? This patch is okay as a standalone > change. > > From: Philip Rakity marvell.com> > Subject: Re: [PATCH v2 5/8] mmc: sdhci: fix null return check of regulator_get > Newsgroups: gmane.linux.kernel.mmc > Date: 2012-09-24 15:02:34 GMT (5 weeks, 6 days, 21 hours and 44 minutes ago) It sounds like I misread this patch, then -- I understood it as only affecting whether a pr_info() call is made, which would not fix a voltage switching bug. What am I missing? (Dan, here's a copy of Kevin's patch.) From: Kevin Liu regulator_get() returns NULL when CONFIG_REGULATOR not defined, which should not print out the warning. Reviewed-by: Philip Rakity Signed-off-by: Bin Wang Signed-off-by: Kevin Liu --- drivers/mmc/host/sdhci.c | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 8e6a6f0..0104ae9 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2845,9 +2845,12 @@ int sdhci_add_host(struct sdhci_host *host) /* If vqmmc regulator and no 1.8V signalling, then there's no UHS */ host->vqmmc = regulator_get(mmc_dev(mmc), "vqmmc"); - if (IS_ERR(host->vqmmc)) { - pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc)); - host->vqmmc = NULL; + if (IS_ERR_OR_NULL(host->vqmmc)) { + if (PTR_ERR(host->vqmmc) < 0) { + pr_info("%s: no vqmmc regulator found\n", + mmc_hostname(mmc)); + host->vqmmc = NULL; + } } else if (regulator_is_supported_voltage(host->vqmmc, 1800000, 1800000)) regulator_enable(host->vqmmc); @@ -2903,9 +2906,12 @@ int sdhci_add_host(struct sdhci_host *host) ocr_avail = 0; host->vmmc = regulator_get(mmc_dev(mmc), "vmmc"); - if (IS_ERR(host->vmmc)) { - pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc)); - host->vmmc = NULL; + if (IS_ERR_OR_NULL(host->vmmc)) { + if (PTR_ERR(host->vmmc) < 0) { + pr_info("%s: no vmmc regulator found\n", + mmc_hostname(mmc)); + host->vmmc = NULL; + } } else regulator_enable(host->vmmc);