d717ea73e3
If pwm_get() finds a look-up entry with a perfect match (both dev_id and
con_id match), the loop is aborted, and "p" still points to the correct
struct pwm_lookup.
If only an entry with a matching dev_id or con_id is found, the loop
terminates after traversing the whole list, and "p" now points to
arbitrary memory, not part of the pwm_lookup list.
Then pwm_set_period() and pwm_set_polarity() will set random values for
period resp. polarity.
To fix this, save period and polarity when finding a new best match,
just like is done for chip (for the provider) and index.
This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
period 0 and polarity -1068821144 instead of 33333 resp. 1.
Fixes:
|
||
---|---|---|
.. | ||
core.c | ||
Kconfig | ||
Makefile | ||
pwm-ab8500.c | ||
pwm-atmel-tcb.c | ||
pwm-atmel.c | ||
pwm-bcm-kona.c | ||
pwm-bfin.c | ||
pwm-clps711x.c | ||
pwm-ep93xx.c | ||
pwm-fsl-ftm.c | ||
pwm-imx.c | ||
pwm-jz4740.c | ||
pwm-lp3943.c | ||
pwm-lpc32xx.c | ||
pwm-lpss.c | ||
pwm-mxs.c | ||
pwm-pca9685.c | ||
pwm-puv3.c | ||
pwm-pxa.c | ||
pwm-renesas-tpu.c | ||
pwm-rockchip.c | ||
pwm-samsung.c | ||
pwm-spear.c | ||
pwm-sti.c | ||
pwm-tegra.c | ||
pwm-tiecap.c | ||
pwm-tiehrpwm.c | ||
pwm-tipwmss.c | ||
pwm-tipwmss.h | ||
pwm-twl-led.c | ||
pwm-twl.c | ||
pwm-vt8500.c | ||
sysfs.c |