From 1a679930e1750c342d7e5fac787dc47484daec2e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 30 Nov 2012 13:19:33 +0800 Subject: [PATCH 1/2] regulator: wm831x-dcdc: Ensure selected voltage falls within requested range Use DIV_ROUND_UP to ensure selected voltage won't less than min_uV due to integer truncation. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/wm831x-dcdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 782c228a19bd..411cb12385aa 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -223,7 +223,7 @@ static int wm831x_buckv_map_voltage(struct regulator_dev *rdev, if (min_uV < 600000) vsel = 0; else if (min_uV <= 1800000) - vsel = ((min_uV - 600000) / 12500) + 8; + vsel = DIV_ROUND_UP(min_uV - 600000, 12500) + 8; else return -EINVAL; From 43f1f2165e12d15a262ad1d0827d2960fe66f75b Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 30 Nov 2012 20:39:53 +0800 Subject: [PATCH 2/2] regulator: wm831x-dcdc: Add MODULE_ALIAS for wm831x-boostp Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- drivers/regulator/wm831x-dcdc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 411cb12385aa..26802608a29c 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -993,4 +993,5 @@ MODULE_DESCRIPTION("WM831x DC-DC convertor driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:wm831x-buckv"); MODULE_ALIAS("platform:wm831x-buckp"); +MODULE_ALIAS("platform:wm831x-boostp"); MODULE_ALIAS("platform:wm831x-epe");