Re: [PATCH v2 1/2] regulator: add support for regulators on theab8500 MFD

From: Thiago Farina
Date: Wed Oct 27 2010 - 12:25:52 EST


On Tue, Jul 13, 2010 at 12:09 PM, Sundar Iyer
<sundar.iyer@xxxxxxxxxxxxxx> wrote:
> +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;
--
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/