From 7b1976a84d6c5eb0da8d516f21ad7f8ea91da838 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BC=A0=E6=99=B4?= Date: Mon, 24 Mar 2014 18:11:41 +0800 Subject: [PATCH] rk3288:pwm_regulator:slove set pwm voltage out of table --- drivers/regulator/rockchip-pwm-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/rockchip-pwm-regulator.c b/drivers/regulator/rockchip-pwm-regulator.c index 15d3acfcfc95..ad72c3b7916c 100755 --- a/drivers/regulator/rockchip-pwm-regulator.c +++ b/drivers/regulator/rockchip-pwm-regulator.c @@ -35,7 +35,7 @@ #include -#if 0 +#if 1 #define DBG(x...) printk(KERN_INFO x) #else #define DBG(x...) @@ -107,9 +107,9 @@ static int pwm_regulator_set_voltage(struct regulator_dev *dev, u32 size = g_pdata->pwm_vol_map_count; u32 i, vol,pwm_value; - DBG("%s: min_uV = %d, max_uV = %d \n",__FUNCTION__, min_uV,max_uV); + DBG("%s: min_uV = %d, max_uV = %d\n",__FUNCTION__, min_uV,max_uV); - if (min_uV < voltage_map[0] ||max_uV > voltage_map[size]) + if (min_uV < voltage_map[0] ||max_uV > voltage_map[size-1]) { printk("%s: voltage_map voltage is out of table\n",__func__); return -EINVAL; -- 2.34.1