WSL2-Linux-Kernel/drivers/pwm
Uwe Kleine-König 822c8bb7b9 pwm: sti: Simplify probe function using devm functions
[ Upstream commit 5bb0b194aeee5d5da6881232f4e9989b35957c25 ]

Instead of of_clk_get_by_name() use devm_clk_get_prepared() which has
several advantages:

 - Combines getting the clock and a call to clk_prepare(). The latter
   can be dropped from sti_pwm_probe() accordingly.
 - Cares for calling clk_put() which is missing in both probe's error
   path and the remove function.
 - Cares for calling clk_unprepare() which can be dropped from the error
   paths and the remove function. (Note that not all error path got this
   right.)

With additionally using devm_pwmchip_add() instead of pwmchip_add() the
remove callback can be dropped completely. With it the last user of
platform_get_drvdata() goes away and so platform_set_drvdata() can be
dropped from the probe function, too.

Fixes: 378fe115d1 ("pwm: sti: Add new driver for ST's PWM IP")
Link: https://lore.kernel.org/r/81f0e1d173652f435afda6719adaed1922fe059a.1710068192.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16 13:39:23 +02:00
..
Kconfig
Makefile
core.c
pwm-ab8500.c pwm: ab8500: Fix error code in probe() 2023-07-23 13:47:27 +02:00
pwm-atmel-hlcdc.c pwm: atmel-hlcdc: Fix clock imbalance related to suspend support 2024-03-26 18:21:18 -04:00
pwm-atmel-tcb.c pwm: atmel-tcb: Fix resource freeing in error path and remove 2023-09-19 12:22:57 +02:00
pwm-atmel.c
pwm-bcm-iproc.c
pwm-bcm-kona.c
pwm-bcm2835.c
pwm-berlin.c
pwm-brcmstb.c pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 11:08:28 +01:00
pwm-clps711x.c
pwm-crc.c
pwm-cros-ec.c pwm: cros-ec: Explicitly set .polarity in .get_state() 2023-04-13 16:48:17 +02:00
pwm-dwc.c
pwm-ep93xx.c
pwm-fsl-ftm.c
pwm-hibvt.c pwm: hibvt: Explicitly set .polarity in .get_state() 2023-04-26 13:51:55 +02:00
pwm-img.c
pwm-imx-tpm.c pwm: imx-tpm: force 'real_period' to be zero in suspend 2023-07-23 13:47:26 +02:00
pwm-imx1.c
pwm-imx27.c
pwm-intel-lgm.c
pwm-iqs620a.c pwm: iqs620a: Explicitly set .polarity in .get_state() 2023-04-26 13:51:55 +02:00
pwm-jz4740.c pwm: jz4740: Don't use dev_err_probe() in .request() 2024-01-25 14:52:48 -08:00
pwm-keembay.c
pwm-lp3943.c
pwm-lpc18xx-sct.c
pwm-lpc32xx.c pwm: lpc32xx: Remove handling of PWM channels 2023-09-19 12:22:58 +02:00
pwm-lpss-pci.c
pwm-lpss-platform.c
pwm-lpss.c
pwm-lpss.h
pwm-mediatek.c
pwm-meson.c pwm: meson: fix handling of period/duty if greater than UINT_MAX 2023-08-03 10:22:30 +02:00
pwm-mtk-disp.c pwm: mtk_disp: Fix the disable flow of disp_pwm 2023-07-23 13:47:27 +02:00
pwm-mxs.c
pwm-ntxec.c
pwm-omap-dmtimer.c
pwm-pca9685.c
pwm-pxa.c
pwm-raspberrypi-poe.c
pwm-rcar.c
pwm-renesas-tpu.c
pwm-rockchip.c
pwm-samsung.c
pwm-sifive.c
pwm-sl28cpld.c
pwm-spear.c
pwm-sprd.c pwm: sprd: Explicitly set .polarity in .get_state() 2023-04-13 16:48:17 +02:00
pwm-sti.c pwm: sti: Simplify probe function using devm functions 2024-06-16 13:39:23 +02:00
pwm-stm32-lp.c
pwm-stm32.c pwm: stm32: Fix enable count for clk in .probe() 2024-01-25 14:52:45 -08:00
pwm-stmpe.c
pwm-sun4i.c
pwm-tegra.c
pwm-tiecap.c
pwm-tiehrpwm.c
pwm-twl-led.c
pwm-twl.c
pwm-visconti.c
pwm-vt8500.c
sysfs.c pwm: sysfs: Do not apply state to already disabled PWMs 2023-07-23 13:47:26 +02:00