[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinc50bzQawaoA_XfkLhJXjVjPWzxgbCJ40UnYwi@mail.gmail.com>
Date: Wed, 27 Oct 2010 14:25:44 -0200
From: Thiago Farina <tfransosi@...il.com>
To: Sundar Iyer <sundar.iyer@...ricsson.com>
Cc: lrg@...mlogic.co.uk, broonie@...nsource.wolfsonmicro.com,
sameo@...ux.intel.com, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
STEricsson_nomadik_linux@...t.st.com,
Linus Walleij <linus.walleij@...ricsson.com>,
Bengt JONSSON <bengt.g.jonsson@...ricsson.com>
Subject: Re: [PATCH v2 1/2] regulator: add support for regulators on the
ab8500 MFD
On Tue, Jul 13, 2010 at 12:09 PM, Sundar Iyer
<sundar.iyer@...ricsson.com> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists