Skip to content

rust: treewide: remove driver unbind callbacks

Danilo Krummrich driver-core linux-pci linux-serial linux-usb lkml rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7rust: pci: remove the unbind() callbackrust/kernel/pci.rs samples/rust/rust_driver_pci.rs+6 -350 replies
2/7rust: platform: remove the unbind() callbackrust/kernel/platform.rs samples/rust/rust_i2c_client.rs+10 -360 replies
3/7rust: auxiliary: remove the unbind() callbackrust/kernel/auxiliary.rs+4 -300 replies
4/7rust: serdev: remove the unbind() callbackrust/kernel/serdev.rs+4 -371 reply
5/7rust: i2c: remove the unbind() callbackrust/kernel/i2c.rs samples/rust/rust_driver_i2c.rs+16 -330 replies
6/7rust: usb: remove the disconnect() callbackrust/kernel/usb.rs samples/rust/rust_driver_usb.rs+12 -350 replies
7/7rust: driver: document teardown through destructorsrust/kernel/driver.rs+7 -110 replies

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchMarkus Probst
1/7
2/7
3/7
4/7R-b
5/7
6/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] rust: treewide: remove driver unbind callbacks

The driver model uses native Rust lifetimes, allowing driver data to retain device resources and a bound device reference for use in its destructor. Separate teardown callbacks are therefore no longer needed.

Remove unbind() from the PCI, platform, auxiliary, serdev and I2C driver traits, and disconnect() from the USB driver trait. Move the affected sample teardown into destructors and update the driver documentation.

Danilo Krummrich (7):
rust: pci: remove the unbind() callback
rust: platform: remove the unbind() callback
rust: auxiliary: remove the unbind() callback
rust: serdev: remove the unbind() callback
rust: i2c: remove the unbind() callback
rust: usb: remove the disconnect() callback
rust: driver: document teardown through destructors

 rust/kernel/auxiliary.rs        | 34 ++++-----------------------
 rust/kernel/driver.rs           | 18 ++++++---------
 rust/kernel/i2c.rs              | 31 ++++---------------------
 rust/kernel/pci.rs              | 34 ++++-----------------------
 rust/kernel/platform.rs         | 34 ++++-----------------------
 rust/kernel/serdev.rs           | 41 ++++-----------------------------
 rust/kernel/usb.rs              | 36 +++++------------------------
 samples/rust/rust_driver_i2c.rs | 18 ++++++++++-----
 samples/rust/rust_driver_pci.rs |  7 ++----
 samples/rust/rust_driver_usb.rs | 11 +++++----
 samples/rust/rust_i2c_client.rs | 12 +++++-----
 11 files changed, 59 insertions(+), 217 deletions(-)

base-commit: de7625abe4e92f1fb0047ed5f163b2ecaba77e50

Signature · 1 line
2.56.0