On Wed, Apr 16, 2014 at 01:15:53PM -0700, Andrew Bresticker wrote: > Not true. If !CONFIG_REGULATOR, regulator_get() and co. will return > NULL. Normally it is ok to ignore this case, but the sdhci driver > will call regulator_is_supported_voltage() on vqmmc to determine > whether 1.8V signalling is supported. With !CONFIG_REGULATOR, > regulator_is_supported_voltage() will always return false, causing the > sdhci driver to disable all UHS modes. So we still need to handle the > NULL (!CONFIG_REGULATOR) case. One possibility is to guard the > voltage check with #ifdef CONFIG_REGULATOR, as is done later with > vmmc. It seems better to just fix regulator_get_optional() to return an error if the API is disabled, that case didn't really get considered since it's a bit surprising that something actively using regulators (rather than simply ensuring they're enabled) would be using that function. Though if you already have ifdefs the ifdef is probably fine.
Attachment:
signature.asc
Description: Digital signature