summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-19 09:03:59 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-19 09:03:59 -0700
commita288cd69f7dea3cd232b721f935c379b74a69814 (patch)
tree3e79016fd27060305d9fc71bf68128a8bcb23e5e /rust
parent1be05c6afbb2c4052d0a13fc91ddcd89aaee9614 (diff)
parentb4e94b0418ad6dbe62b6ca53369159ed3d9f0d8c (diff)
downloadlinux-a288cd69f7dea3cd232b721f935c379b74a69814.tar.gz
linux-a288cd69f7dea3cd232b721f935c379b74a69814.zip
Merge tag 'pwm/for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux
Pull pwm updates from Uwe Kleine-König: "A bunch of cleanups - in C and Rust - and a devicetree and driver extension for a new SoC variant. Thanks to Biju Das, Francis Laniel, Guru Das Srinagesh, Markus Elfring, Mikko Perttunen, Thierry Reding, and Yi-Wei Wang for their changes and further Alexandre Courbot, Benno Lossin, Chen Wang, Geert Uytterhoeven, Jon Hunter, Laurent Pinchart, Michal Wilczynski, Mikko Perttunen, and Rob Herring for valuable review feedback" * tag 'pwm/for-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: pwm: th1520: use vertical import style rust: pwm: replace `core::mem::zeroed` with `pin_init::zeroed` pwm: rzg2l-gpt: Drop unused rzg2l_gpt_chip parameter from rzg2l_gpt_calculate_prescale() pwm: Use seq_putc() calls in pwm_dbg_show() pwm: tegra: Add support for Tegra264 pwm: tegra: Parametrize duty and scale field widths pwm: tegra: Modify read/write accessors for multi-register channel pwm: tegra: Avoid hard-coded max clock frequency pwm: tegra: Prefix driver-local macros and functions dt-bindings: pwm: Document Tegra264 controller pwm: lpss-pci: Unify coding style of pci_device_id array pwm: Unify coding style of of_device_id arrays pwm: Unify coding style of acpi_device_id arrays pwm: Use named initializers for arrays of acpi_device_id pwm: pca9685: Drop unused assignment of acpi_device_id driver data pwm: pxa: Depend on OF and simplify accordingly pwm: Use named initializers for platform_device_id arrays pwm: mc33xs2410: Initialize spi_device_id arrays using member names
Diffstat (limited to 'rust')
-rw-r--r--rust/kernel/pwm.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/rust/kernel/pwm.rs b/rust/kernel/pwm.rs
index 8b3a580b4f0f..8aa47304bec3 100644
--- a/rust/kernel/pwm.rs
+++ b/rust/kernel/pwm.rs
@@ -494,9 +494,7 @@ impl PwmOpsVTable {
/// This is used to bridge Rust trait implementations to the C `struct pwm_ops`
/// expected by the kernel.
pub const fn create_pwm_ops<T: PwmOps>() -> PwmOpsVTable {
- // SAFETY: `core::mem::zeroed()` is unsafe. For `pwm_ops`, all fields are
- // `Option<extern "C" fn(...)>` or data, so a zeroed pattern (None/0) is valid initially.
- let mut ops: bindings::pwm_ops = unsafe { core::mem::zeroed() };
+ let mut ops: bindings::pwm_ops = pin_init::zeroed();
ops.request = Some(Adapter::<T>::request_callback);
ops.capture = Some(Adapter::<T>::capture_callback);