[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF+7xWmR-ogy2k+e5D0og7gUPeb7dVF0ZE61QaVDeQV=6y+PcQ@mail.gmail.com>
Date: Tue, 26 Jun 2012 20:40:42 +0800
From: Axel Lin <axel.lin@...il.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] regulator: core: Check that the selector from
map_voltage() is valid
2012/6/26 Mark Brown <broonie@...nsource.wolfsonmicro.com>:
> Lots of regulator drivers have checks in their map_voltage() functions
> to verify that the result of the mapping is in the range originally
> specified. Factor these out in the core and provide a bit of extra
> defensiveness for other drivers by doing the check in the core.
>
> Since we're now doing a list_voltage() earlier move the current mapping
> back to a voltage out into the set_voltage() call to save redoing it.
>
> Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Hi Mark,
This patch does not apply to both linux-next tree and regulator tree
(for-next branch).
I got below diff in drivers/regulator/core.c.rej.
--- drivers/regulator/core.c
+++ drivers/regulator/core.c
@@ -2119,10 +2128,8 @@
}
if (ret >= 0) {
- if (min_uV < rdev->desc->ops->list_voltage(rdev,
- ret) &&
- max_uV > rdev->desc->ops->list_voltage(rdev,
- ret)) {
+ best_val = rdev->desc->ops->list_voltage(rdev, ret);
+ if (min_uV <= best_val && max_uV >= best_val) {
selector = ret;
ret = rdev->desc->ops->set_voltage_sel(rdev,
ret);
Regards,
Axel
--
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