Re: [Patch 5/11] Regulator: DA9052 regulator support v2

From: Mark Brown
Date: Tue Jul 05 2011 - 12:28:51 EST


On Wed, Jun 29, 2011 at 06:46:03PM +0530, ashishj3 wrote:

> +static int verify_range(struct da9052_regulator_info *info,
> + int min_uV, int max_uV)
> +{
> + if (min_uV < info->min_uV || min_uV > info->max_uV)
> + return -EINVAL;
> + if (max_uV < info->min_uV || max_uV > info->max_uV)
> + return -EINVAL;

This is broken, think about what it's trying to do - it's trying to
check that the regulator can deliver a voltage within the requested
range. These checks don't help with that.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/