Signed-off-by: Axel Lin <axel....@ingics.com>
---
Hi Pawel,
I don't have a chance to compile test this patch because I could not
find VEXPRESS_CONFIG in current tree.
Can you help testing this patch?

Thanks,
Axel
 drivers/regulator/vexpress.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/vexpress.c b/drivers/regulator/vexpress.c
index 1702945..94a8cb9 100644
--- a/drivers/regulator/vexpress.c
+++ b/drivers/regulator/vexpress.c
@@ -86,10 +86,14 @@ static int vexpress_regulator_probe(struct platform_device 
*pdev)
        }
 
        init_data->constraints.apply_uV = 0;
-       if (init_data->constraints.min_uV && init_data->constraints.max_uV)
+       if (init_data->constraints.min_uV && init_data->constraints.max_uV) {
                reg->desc.ops = &vexpress_regulator_ops;
-       else
+               reg->desc.n_voltages = init_data->constraints.max_uV -
+                                      init_data->constraints.min_uV + 1;
+       } else {
                reg->desc.ops = &vexpress_regulator_ops_ro;
+               reg->desc.n_voltages = 1;
+       }
 
        config.dev = &pdev->dev;
        config.init_data = init_data;
-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to