Re: drivers/regulator/core.c: Fixes mapping insideregulator_mode_to_status() and makes it returning -EINVAL oninvalid input.

From: Mark Brown
Date: Mon Jan 09 2012 - 19:14:49 EST


On Tue, Jan 10, 2012 at 12:11:33AM +0000, dd diasemi wrote:

> Making regulator_mode_to_status() returning an error allows to
> simplify its usage:
> ret = regulator_mode_to_status(regulator_get_mode(rdev));
> if (ret < 0)
> ret = -EIO;

That code would definitely be less than ideal - if we got an error back
from the attempt to read the mode we ought to be returning that error
not squashing it down to a single value.
--
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/