[UPSTREAM PATCH] glamo_mci_use_regulator_api.patch

Mark Brown broonie at opensource.wolfsonmicro.com
Wed Oct 29 20:30:07 CET 2008


On Wed, Oct 29, 2008 at 08:46:33PM +0530, Balaji Rao wrote:

Not a detailed review but...

> +			.num_consumer_supplies = 1,
> +			.consumer_supplies = hcldo_consumers,

It's a bit more idiomatic to use ARRAY_SIZE() for num_consumer_supplies,
if only to avoid someone having to look back to the declaration of the
supply array to check the count.

> +	host->regulator = regulator_get(&pdev->dev, "SD_3V3");
> +	if (!host->regulator) {
> +		dev_err(&pdev->dev, "Cannot proceed without regulator.\n");
> +		return -ENODEV;
> +	}

regulator_get() returns an ERR_PTR() so you should check with IS_ERR().



More information about the openmoko-kernel mailing list