Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755818Ab0KHWME (ORCPT ); Mon, 8 Nov 2010 17:12:04 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:63634 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755318Ab0KHWMC convert rfc822-to-8bit (ORCPT ); Mon, 8 Nov 2010 17:12:02 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=epSIhXh1zhLR0hVRFBYlwiNni22q5RPbQlympW98svLeZDNAro8oE7nz3xJ1UY526b oPnPgd/8+Srns6tJoUVcVuqDymbMJi5jDb01tZcZUfrj23skLB9UmU2L5l+pyZxpQjoU 5bdJsJUHNDyOZBcIA1BUr92REKAnwhWLnXVso= MIME-Version: 1.0 In-Reply-To: <1288656337.29881.13.camel@realization> References: <1288656337.29881.13.camel@realization> Date: Mon, 8 Nov 2010 23:12:01 +0100 Message-ID: Subject: Re: [PATCH] mxcmmc: Add the ability to bind a regulator to manage the MMC card voltage From: Linus Walleij To: Alberto Panizzo Cc: Sascha Hauer , Daniel Mack , Andrew Morton , =?ISO-8859-1?Q?Uwe_Kleine=2DK=F6nig?= , =?ISO-8859-1?Q?Eric_B=E9nard?= , Fabio Estevam , linux-kernel , linux-mmc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1301 Lines: 39 2010/11/2 Alberto Panizzo : > +static inline void mxcmci_init_ocr(struct mxcmci_host *host) > +{ > +#ifdef CONFIG_REGULATOR > + ? ? ? host->vcc = regulator_get(mmc_dev(host->mmc), "vmmc"); > + > + ? ? ? if (IS_ERR(host->vcc)) { > + ? ? ? ? ? ? ? host->vcc = NULL; > + ? ? ? } else { > + ? ? ? ? ? ? ? host->mmc->ocr_avail = mmc_regulator_get_ocrmask(host->vcc); > + ? ? ? ? ? ? ? if (host->pdata && host->pdata->ocr_avail) > + ? ? ? ? ? ? ? ? ? ? ? dev_warn(mmc_dev(host->mmc), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "pdata->ocr_avail will not be used\n"); > + ? ? ? } > +#endif You don't need these #ifdef CONFIG_REGULATOR guardposts anymore. I implemented stub functions for the ocrmask functions for 2.6.37. > +static inline void mxcmci_set_power(struct mxcmci_host *host, unsigned int vdd) > +{ > +#ifdef CONFIG_REGULATOR > + ? ? ? if (host->vcc) > + ? ? ? ? ? ? ? mmc_regulator_set_ocr(host->vcc, vdd); > +#endif Neither here. But for both cases: no big deal. Take it the day it disturbs you :-) Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/