提交 935c14a2 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: ad5398: show changing current in uA

Integer division may truncate the result.
Current code shows changing current is 0mA when selector is 1 ... 8.

For example:
selector = 1
ad5398_calc_current returns 117, debug message shows 117/1000 = 0mA
selector = 2
ad5398_calc_current returns 234, debug message shows 234/1000 = 0mA
selector = 3
ad5398_calc_current returns 351, debug message shows 351/1000 = 0mA
............
selector = 8
ad5398_calc_current returns 937, debug message shows 937/1000 = 0mA

Show the changing current in uA makes it easier for debugging.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Acked-by: NSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 36a2afd8
......@@ -99,8 +99,8 @@ static int ad5398_set_current_limit(struct regulator_dev *rdev, int min_uA, int
if (ad5398_calc_current(chip, selector) > max_uA)
return -EINVAL;
dev_dbg(&client->dev, "changing current %dmA\n",
ad5398_calc_current(chip, selector) / 1000);
dev_dbg(&client->dev, "changing current %duA\n",
ad5398_calc_current(chip, selector));
/* read chip enable bit */
ret = ad5398_read_reg(client, &data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册