• Boris Brezillon's avatar
    pwm: Fix pwm_apply_args() call sites · fbd45a12
    Boris Brezillon authored
    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 e39c0df1 ("pwm: Introduce the pwm_args concept").
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    Fixes: e39c0df1 ("pwm: Introduce the pwm_args concept")
    Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
    fbd45a12
core.c 21.8 KB