summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2026-05-29 01:53:14 +0300
committerDanilo Krummrich <dakr@kernel.org>2026-05-29 01:53:14 +0300
commita3e50e7279996cd987001fd8a3db36e72665f8f7 (patch)
treed5abdce1f60809b46565e2f15dd0ede0dea39994 /include/linux
parent9c81596851a342e68ec200f69fc1d5c1dbede289 (diff)
parentd18f3646184fc805d213fc049fc3b5d9fb9a6a27 (diff)
downloadlinux-a3e50e7279996cd987001fd8a3db36e72665f8f7.tar.xz
Merge tag 'dd-lifetimes-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core into drm-rust-next
Higher-Ranked Lifetime Types for Rust device drivers Replace drvdata() with registration data on the auxiliary bus. Private data is now scoped to the registration object, removing the ordering constraints and lifetime complications that came with drvdata(). Add Higher-Ranked Lifetime Types (HRT) so driver structs can borrow device resources like pci::Bar and IoMem directly, tied to the device binding scope. This removes the need for Devres indirection and ARef<Device> in most driver code. This is a stable tag for other trees to merge. Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/auxiliary_bus.h4
-rw-r--r--include/linux/device/driver.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/auxiliary_bus.h b/include/linux/auxiliary_bus.h
index bc09b55e3682..4e1ad8ccbcdd 100644
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -62,6 +62,9 @@
* @sysfs.irqs: irqs xarray contains irq indices which are used by the device,
* @sysfs.lock: Synchronize irq sysfs creation,
* @sysfs.irq_dir_exists: whether "irqs" directory exists,
+ * @registration_data_rust: private data owned by the registering (parent)
+ * driver; valid for as long as the device is
+ * registered with the driver core,
*
* An auxiliary_device represents a part of its parent device's functionality.
* It is given a name that, combined with the registering drivers
@@ -148,6 +151,7 @@ struct auxiliary_device {
struct mutex lock; /* Synchronize irq sysfs creation */
bool irq_dir_exists;
} sysfs;
+ void *registration_data_rust;
};
/**
diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
index bbc67ec513ed..38e9a4679447 100644
--- a/include/linux/device/driver.h
+++ b/include/linux/device/driver.h
@@ -123,8 +123,8 @@ struct device_driver {
struct driver_private *p;
struct {
/*
- * Called after remove() and after all devres entries have been
- * processed. This is a Rust only callback.
+ * Called after remove() but before devres entries are released.
+ * This is a Rust only callback.
*/
void (*post_unbind_rust)(struct device *dev);
} p_cb;