Skip to content

Commit 96f4e74

Browse files
Darksonnojeda
authored andcommitted
pwm: th1520: remove impl Send/Sync for Th1520PwmDriverData
Now that clk implements Send and Sync, we no longer need to manually implement these traits for Th1520PwmDriverData. Thus remove the implementations. Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Acked-by: Uwe Kleine-König <ukleinek@kernel.org> Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20260223-clk-send-sync-v5-3-181bf2f35652@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent ef90b10 commit 96f4e74

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

drivers/pwm/pwm_th1520.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,6 @@ struct Th1520PwmDriverData {
9999
clk: Clk,
100100
}
101101

102-
// This `unsafe` implementation is a temporary necessity because the underlying `kernel::clk::Clk`
103-
// type does not yet expose `Send` and `Sync` implementations. This block should be removed
104-
// as soon as the clock abstraction provides these guarantees directly.
105-
// TODO: Remove those unsafe impl's when Clk will support them itself.
106-
107-
// SAFETY: The `devres` framework requires the driver's private data to be `Send` and `Sync`.
108-
// We can guarantee this because the PWM core synchronizes all callbacks, preventing concurrent
109-
// access to the contained `iomem` and `clk` resources.
110-
unsafe impl Send for Th1520PwmDriverData {}
111-
112-
// SAFETY: The same reasoning applies as for `Send`. The PWM core's synchronization
113-
// guarantees that it is safe for multiple threads to have shared access (`&self`)
114-
// to the driver data during callbacks.
115-
unsafe impl Sync for Th1520PwmDriverData {}
116-
117102
impl pwm::PwmOps for Th1520PwmDriverData {
118103
type WfHw = Th1520WfHw;
119104

0 commit comments

Comments
 (0)