]> git.ipfire.org Git - thirdparty/linux.git/commit
pwm: Export `pwmchip_release` for external use
authorMichal Wilczynski <m.wilczynski@samsung.com>
Thu, 16 Oct 2025 13:38:01 +0000 (15:38 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Fri, 7 Nov 2025 09:03:53 +0000 (10:03 +0100)
commitce284f882022ebcb953984c7eccf4fc4eb531978
tree2fec07eb8805b3af44ba12d4bf9b6f0f0038cb5e
parent739ad9be61e5f53dbd8d7d7e80723d0799ff077c
pwm: Export `pwmchip_release` for external use

The upcoming Rust abstraction layer for the PWM subsystem uses a custom
`dev->release` handler to safely manage the lifetime of its driver
data.

To prevent leaking the memory of the `struct pwm_chip` (allocated by
`pwmchip_alloc`), this custom handler must also call the original
`pwmchip_release` function to complete the cleanup.

Make `pwmchip_release` a global, exported function so that it can be
called from the Rust FFI bridge. This involves removing the `static`
keyword, adding a prototype to the public header, and exporting the
symbol.

Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Link: https://patch.msgid.link/20251016-rust-next-pwm-working-fan-for-sending-v16-1-a5df2405d2bd@samsung.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/core.c
include/linux/pwm.h