]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: Fix pwm_apply_args() call sites
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Tue, 17 May 2016 12:27:25 +0000 (14:27 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 17 May 2016 12:41:18 +0000 (14:41 +0200)
commit212f188b46f05c2b1be6de8f21576d721349b7a8
tree67d84a279f38b1582fb0345a9d81cd474cfa7965
parent899515b8a6be4455856ef923b2f76351bbd58c36
pwm: Fix pwm_apply_args() call sites

pwm_apply_args() is supposed to initialize a PWM device according to the
arguments provided by the DT or the PWM lookup, but this function was
called inside pwm_device_request(), which in turn was called before the
core had a chance to initialize the pwm->args fields.

Fix that by calling pwm_apply_args directly in pwm_get() and of_pwm_get()
after initializing pwm->args field.

This commit also fixes an invalid pointer dereference introduced by
commit 899515b8a6be ("pwm: Introduce the pwm_args concept").

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Fixes: 899515b8a6be ("pwm: Introduce the pwm_args concept")
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c