[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <042001cd493e$57920600$06b61200$@com>
Date: Wed, 13 Jun 2012 17:27:16 +0900
From: Sangbeom Kim <sbkim73@...sung.com>
To: 'Mark Brown' <broonie@...nsource.wolfsonmicro.com>,
'Liam Girdwood' <lrg@...com>
Cc: linux-kernel@...r.kernel.org, sbkim01@...il.com
Subject: [PATCH 2/5] regulator: Fix the s5m8767a problem of the division by null
If ramp_delay is 0, delay value can be divided by zero.
This patch can fix the problem.
Signed-off-by: Sangbeom Kim <sbkim73@...sung.com>
---
drivers/regulator/s5m8767.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 4edf344..ce9dda2 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -451,7 +451,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
desc = reg_voltage_map[reg_id];
- if (old_sel < new_sel)
+ if ((old_sel < new_sel) && s5m8767->ramp_delay)
return DIV_ROUND_UP(desc->step * (new_sel - old_sel),
s5m8767->ramp_delay * 1000);
return 0;
--
1.7.1
--
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