On Tue, Jul 13, 2010 at 12:09 PM, Sundar Iyer
<sundar.iyer@stericsson.com> wrote:
quoted text > +static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)
> +{
> + int regulator_id, ret;
> + struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
> +
> + regulator_id = rdev_get_id(rdev);
> + if (regulator_id >= AB8500_NUM_REGULATORS)
> + return -EINVAL;
> +
> + ret = ab8500_read(info->ab8500, info->update_reg);
> + if (ret < 0) {
> + dev_dbg(rdev_get_dev(rdev),
> + "couldnt read 0x%x register\n", info->update_reg);
> + return ret;
> + }
> +
> + if (ret & info->mask)
> + return true;
> + else
> + return false;
> +}
Shouldn't be this returning 1 instead of true and 0 instead false
(since the return type is int not bool)?
Maybe like this?
return (ret & info->mask) ? 1: 0;
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [PATCH v2 1/2] regulator: add support for regulators o ... , Thiago Farina , (Wed Oct 27, 9:25 am)