diff options
| author | yanyh2 <yanyh2@lenovo.com> | 2017-10-12 12:51:56 +0800 |
|---|---|---|
| committer | Davide Garberi <dade.garberi@gmail.com> | 2022-07-27 19:23:18 +0200 |
| commit | 5e4164aab9a8d2db00694ff22d41fd7f6dc8ee67 (patch) | |
| tree | 64fa06b689d6817634f1ef31e0ef8b73f736b26f /drivers/pwm/pwm-qpnp.c | |
| parent | 8b9bff05448b2d0f7d2c7ac38aa4ed4dfa2cf303 (diff) | |
pwm-qpnp: fix the uninitialized pwm mode issue
If the led request the PWM mode and the initial mode is PWM
when change the led pwm mode, it will fail to change pwm mode
for no mode change with a uninitialized return code and cause
the LED configuration failing
Change-Id: I29ba3823fb7b4f0d1b2a0d9f22c464c94fbe9717
Signed-off-by: yanyh2 <yanyh2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1072946
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Coverity Analysis <coverity@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-qpnp.c')
| -rw-r--r-- | drivers/pwm/pwm-qpnp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-qpnp.c b/drivers/pwm/pwm-qpnp.c index fecec1e2738c..d028b091d813 100644 --- a/drivers/pwm/pwm-qpnp.c +++ b/drivers/pwm/pwm-qpnp.c @@ -2230,8 +2230,10 @@ static int qpnp_parse_dt_config(struct platform_device *pdev, } rc = of_property_read_u32(of_node, "qcom,mode-select", &mode); - if (rc) + if (rc) { + chip->pwm_mode = -EINVAL; goto read_opt_props; + } if (mode > PM_PWM_MODE_LPG || (mode == PM_PWM_MODE_PWM && found_pwm_subnode == 0) || |
