Em Qui, 2009-05-07 às 09:27 +0100, Mark Brown escreveu: > On Thu, May 07, 2009 at 04:13:53AM -0300, Daniel Ribeiro wrote: > > > +#else > > +static int pxamci_regulator_get(struct pxamci_host *host) > > +{ > > + return 0; > > +} > > +static void pxamci_regulator_put(struct pxamci_host *host) {} > > regulator_get() and regulator_put() compile out if regulator is not > defined, though you will get a dummy regulator back.
Will regulator_get() return an error case config_regulator is not defined? Im relying on this to use the pdata case config_regulator is not set. > > > - mmc->ocr_avail = host->pdata ? > > + if (pxamci_regulator_get(&pdev->dev, host) == 0) > > + mmc->ocr_avail = pxamci_regulator_get_ocrmask(host); > > + else > > + mmc->ocr_avail = host->pdata ? > > host->pdata->ocr_mask : > > MMC_VDD_32_33|MMC_VDD_33_34; > > mmc->caps = 0; > > Are you sure this does the right thing if regulator API is compiled out? > The dummy get() will succeed, meaning that we never take the platform > data case which is probably not what you want. No. This is wrong. I will send another version with this fixed. > > What should happen if the system both supplies platform data and a > regulator? If both are supplied and config_regulator is set, then the regulator should be used. If config_regulator is not defined, or if the machine does not supplies a regulator, then pdata->setpower and pdata->ocr_mask should be used instead. -- Daniel Ribeiro