mfd: pm8xxx-pwm: fix debug code bugs
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
diff --git a/drivers/mfd/pm8xxx-pwm.c b/drivers/mfd/pm8xxx-pwm.c
index a6baa2a..ea0d876 100644
--- a/drivers/mfd/pm8xxx-pwm.c
+++ b/drivers/mfd/pm8xxx-pwm.c
@@ -815,6 +815,9 @@
if (PTR_ERR(puser->pwm)) {
pr_err("pwm_request: err=%ld\n", PTR_ERR(puser->pwm));
puser->pwm = NULL;
+ } else {
+ pr_debug("[id=%d] pwm_request ok\n", puser->pwm_id);
+ puser->pwm = tmp;
}
}
}
@@ -870,9 +873,8 @@
if (puser->pwm) {
int duty_us;
- duty_us = puser->duty_cycle * puser->period;
- pwm_config(puser->pwm,
- puser->duty_cycle, puser->period);
+ duty_us = puser->duty_cycle * puser->period / 100;
+ pwm_config(puser->pwm, duty_us, puser->period);
}
}
mutex_unlock(&dbgdev->dbg_mutex);