Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229238/?format=api
{ "id": 2229238, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229238/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260427221155.2144848-12-dakr@kernel.org/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/1.1/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260427221155.2144848-12-dakr@kernel.org>", "date": "2026-04-27T22:11:09", "name": "[11/24] rust: pci: make Driver trait lifetime-parameterized", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "094f94000e4f184005e6f255b62e5af0a00dd342", "submitter": { "id": 89037, "url": "http://patchwork.ozlabs.org/api/1.1/people/89037/?format=api", "name": "Danilo Krummrich", "email": "dakr@kernel.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260427221155.2144848-12-dakr@kernel.org/mbox/", "series": [ { "id": 501733, "url": "http://patchwork.ozlabs.org/api/1.1/series/501733/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501733", "date": "2026-04-27T22:10:58", "name": "rust: device: Higher-Ranked Lifetime Types for device drivers", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501733/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229238/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229238/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-pci+bounces-53279-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=REQ5Dyjo;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53279-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"REQ5Dyjo\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4Hz11Qyrz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:18:53 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 3F4D8312D618\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 22:13:28 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 087E83ACA70;\n\tMon, 27 Apr 2026 22:13:18 +0000 (UTC)", "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id D673E3A9DA5;\n\tMon, 27 Apr 2026 22:13:17 +0000 (UTC)", "by smtp.kernel.org (Postfix) with ESMTPSA id AD84AC19425;\n\tMon, 27 Apr 2026 22:13:11 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777327997; cv=none;\n b=W1hfcM8BwQN+I4FQLrKjbyxxMU1TqFI77Qi+UBbsGyPi+gkJivRtgHgC4g0nKjhJ3jc9jBvFqKNGv8RFcQgp8p+szuisQ/lhbF7tYwXTzVvEGOmZEuXMeMUsTiZX8HrGIefv+wSiI0QkQatO3lz3U0o8Q0KyOKl3RTd0kd6J+co=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777327997; c=relaxed/simple;\n\tbh=mdjo1NZwY5GoH4ibGKBJ7f7j6FWnfOwIVwRbt0mj7p8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=TGsp8DwGUUkUk2GRoukghpy70J56fcHiOrzd4NneFTF4ZwcPum26j91Zw7npr+FUIspl3e1rt1Gc0yDzfM3jUt//c41ph0TbPCVFR8q+O2Yh7wiCDX5XDHHSNgQ2UX4XNxGZTx6g8b8i26MOPqj6qBywqeHbiMO9QqMkdWLD5jE=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=REQ5Dyjo; arc=none smtp.client-ip=10.30.226.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777327997;\n\tbh=mdjo1NZwY5GoH4ibGKBJ7f7j6FWnfOwIVwRbt0mj7p8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=REQ5Dyjo/Xb+75phlrQLoIxvYM5LR5mtCtMVWPLh5geplHJXnuSyrsql6WyyEP4/V\n\t aKFZmr1SXxWKEVFBHAdtlwHRkAOUq+Qv/khAGsMUe0O27l+vzFObYPs8zhpRZyQ5jy\n\t E+siO0xo9hYb0KfxOKUMC5+bkWOvUlNUS7Es7Nq+Xi/SDEmFGaqMnq1QjzGyWfU7R+\n\t DlrGZeV7heLceZgTuCZvAydC5X6MsmudvKfpacI9F9WJKXtXQ1zbZvhaqPinLG0sgB\n\t Y48nbOux0IhkvOcXcCWT9f0dyXlN00y27+YqDB79n3DBFKgdg1Xo/tboW7gwSl2kLr\n\t +UeJ6mGlwoBGw==", "From": "Danilo Krummrich <dakr@kernel.org>", "To": "gregkh@linuxfoundation.org,\n\trafael@kernel.org,\n\tacourbot@nvidia.com,\n\taliceryhl@google.com,\n\tdavid.m.ertman@intel.com,\n\tira.weiny@intel.com,\n\tleon@kernel.org,\n\tviresh.kumar@linaro.org,\n\tm.wilczynski@samsung.com,\n\tukleinek@kernel.org,\n\tbhelgaas@google.com,\n\tkwilczynski@kernel.org,\n\tabdiel.janulgue@gmail.com,\n\trobin.murphy@arm.com,\n\tmarkus.probst@posteo.de,\n\tojeda@kernel.org,\n\tboqun@kernel.org,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tlossin@kernel.org,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu", "Cc": "driver-core@lists.linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tnova-gpu@lists.linux.dev,\n\tdri-devel@lists.freedesktop.org,\n\tlinux-pm@vger.kernel.org,\n\tlinux-pwm@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tDanilo Krummrich <dakr@kernel.org>", "Subject": "[PATCH 11/24] rust: pci: make Driver trait lifetime-parameterized", "Date": "Tue, 28 Apr 2026 00:11:09 +0200", "Message-ID": "<20260427221155.2144848-12-dakr@kernel.org>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260427221155.2144848-1-dakr@kernel.org>", "References": "<20260427221155.2144848-1-dakr@kernel.org>", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Make pci::Driver take a lifetime parameter 'a that ties device resources\nto the binding scope.\n\nInternally, Adapter<T: Driver> becomes Adapter<F: ForLt> with a HRTB\nbound for<'a> F::Of<'a>: Driver<'a>; module_pci_driver! wraps the driver\ntype in ForLt!() so drivers don't have to.\n\nSigned-off-by: Danilo Krummrich <dakr@kernel.org>\n---\n drivers/gpu/nova-core/driver.rs | 9 ++-\n drivers/gpu/nova-core/nova_core.rs | 4 +-\n rust/kernel/pci.rs | 79 +++++++++++++++++++--------\n samples/rust/rust_dma.rs | 9 ++-\n samples/rust/rust_driver_auxiliary.rs | 13 +++--\n samples/rust/rust_driver_pci.rs | 11 ++--\n 6 files changed, 86 insertions(+), 39 deletions(-)", "diff": "diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs\nindex 8fe484d357f6..815489dd92d0 100644\n--- a/drivers/gpu/nova-core/driver.rs\n+++ b/drivers/gpu/nova-core/driver.rs\n@@ -50,7 +50,7 @@ pub(crate) struct NovaCore {\n kernel::pci_device_table!(\n PCI_TABLE,\n MODULE_PCI_TABLE,\n- <NovaCore as pci::Driver>::IdInfo,\n+ <NovaCore as pci::Driver<'_>>::IdInfo,\n [\n // Modern NVIDIA GPUs will show up as either VGA or 3D controllers.\n (\n@@ -72,11 +72,14 @@ pub(crate) struct NovaCore {\n ]\n );\n \n-impl pci::Driver for NovaCore {\n+impl<'a> pci::Driver<'a> for NovaCore {\n type IdInfo = ();\n const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;\n \n- fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {\n+ fn probe(\n+ pdev: &'a pci::Device<Core>,\n+ _info: &'a Self::IdInfo,\n+ ) -> impl PinInit<Self, Error> + 'a {\n pin_init::pin_init_scope(move || {\n dev_dbg!(pdev, \"Probe Nova Core GPU driver.\\n\");\n \ndiff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs\nindex 04a1fa6b25f8..49c093a0cb42 100644\n--- a/drivers/gpu/nova-core/nova_core.rs\n+++ b/drivers/gpu/nova-core/nova_core.rs\n@@ -7,6 +7,7 @@\n driver::Registration,\n pci,\n prelude::*,\n+ types::ForLt,\n InPlaceModule, //\n };\n \n@@ -46,8 +47,9 @@ fn drop(&mut self) {\n struct NovaCoreModule {\n // Fields are dropped in declaration order, so `_driver` is dropped first,\n // then `_debugfs_guard` clears `DEBUGFS_ROOT`.\n+ #[allow(clippy::type_complexity)]\n #[pin]\n- _driver: Registration<pci::Adapter<driver::NovaCore>>,\n+ _driver: Registration<pci::Adapter<ForLt!(driver::NovaCore)>>,\n _debugfs_guard: DebugfsRootGuard,\n }\n \ndiff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs\nindex 6f82f2e6c74f..73d9fcff99c4 100644\n--- a/rust/kernel/pci.rs\n+++ b/rust/kernel/pci.rs\n@@ -58,22 +58,34 @@\n };\n \n /// An adapter for the registration of PCI drivers.\n-pub struct Adapter<T: Driver>(T);\n+///\n+/// `F` is a [`ForLt`](trait@ForLt) type that maps lifetimes to the driver's device\n+/// private data type, i.e. `F::Of<'a>` is the driver struct parameterized by `'a`. The macro\n+/// `module_pci_driver!` generates this automatically via `ForLt!()`.\n+pub struct Adapter<F>(PhantomData<F>);\n \n // SAFETY:\n // - `bindings::pci_driver` is a C type declared as `repr(C)`.\n-// - `T` is the type of the driver's device private data.\n+// - `F::Of<'static>` is the stored type of the driver's device private data.\n // - `struct pci_driver` embeds a `struct device_driver`.\n // - `DEVICE_DRIVER_OFFSET` is the correct byte offset to the embedded `struct device_driver`.\n-unsafe impl<T: Driver + 'static> driver::DriverLayout for Adapter<T> {\n+unsafe impl<F> driver::DriverLayout for Adapter<F>\n+where\n+ F: ForLt + 'static,\n+ for<'a> F::Of<'a>: Driver<'a>,\n+{\n type DriverType = bindings::pci_driver;\n- type DriverData = ForLt!(T);\n+ type DriverData = F;\n const DEVICE_DRIVER_OFFSET: usize = core::mem::offset_of!(Self::DriverType, driver);\n }\n \n // SAFETY: A call to `unregister` for a given instance of `DriverType` is guaranteed to be valid if\n // a preceding call to `register` has been successful.\n-unsafe impl<T: Driver + 'static> driver::RegistrationOps for Adapter<T> {\n+unsafe impl<F> driver::RegistrationOps for Adapter<F>\n+where\n+ F: ForLt + 'static,\n+ for<'a> F::Of<'a>: Driver<'a>,\n+{\n unsafe fn register(\n pdrv: &Opaque<Self::DriverType>,\n name: &'static CStr,\n@@ -84,7 +96,7 @@ unsafe fn register(\n (*pdrv.get()).name = name.as_char_ptr();\n (*pdrv.get()).probe = Some(Self::probe_callback);\n (*pdrv.get()).remove = Some(Self::remove_callback);\n- (*pdrv.get()).id_table = T::ID_TABLE.as_ptr();\n+ (*pdrv.get()).id_table = <F::Of<'static> as Driver<'static>>::ID_TABLE.as_ptr();\n }\n \n // SAFETY: `pdrv` is guaranteed to be a valid `DriverType`.\n@@ -99,7 +111,11 @@ unsafe fn unregister(pdrv: &Opaque<Self::DriverType>) {\n }\n }\n \n-impl<T: Driver + 'static> Adapter<T> {\n+impl<F> Adapter<F>\n+where\n+ F: ForLt + 'static,\n+ for<'a> F::Of<'a>: Driver<'a>,\n+{\n extern \"C\" fn probe_callback(\n pdev: *mut bindings::pci_dev,\n id: *const bindings::pci_device_id,\n@@ -113,12 +129,12 @@ extern \"C\" fn probe_callback(\n // SAFETY: `DeviceId` is a `#[repr(transparent)]` wrapper of `struct pci_device_id` and\n // does not add additional invariants, so it's safe to transmute.\n let id = unsafe { &*id.cast::<DeviceId>() };\n- let info = T::ID_TABLE.info(id.index());\n \n from_result(|| {\n- let data = T::probe(pdev, info);\n+ let info = <F::Of<'_> as Driver<'_>>::ID_TABLE.info(id.index());\n+ let data = <F::Of<'_> as Driver<'_>>::probe(pdev, info);\n \n- pdev.as_ref().set_drvdata::<ForLt!(T)>(data)?;\n+ pdev.as_ref().set_drvdata::<F>(data)?;\n Ok(0)\n })\n }\n@@ -131,16 +147,18 @@ extern \"C\" fn remove_callback(pdev: *mut bindings::pci_dev) {\n let pdev = unsafe { &*pdev.cast::<Device<device::CoreInternal>>() };\n \n // SAFETY: `remove_callback` is only ever called after a successful call to\n- // `probe_callback`, hence it's guaranteed that `Device::set_drvdata()` has been called\n- // and stored a `Pin<KBox<T>>`.\n- let data = unsafe { pdev.as_ref().drvdata_borrow::<ForLt!(T)>() };\n+ // `probe_callback`, hence it's guaranteed that drvdata has been set.\n+ let data = unsafe { pdev.as_ref().drvdata_borrow::<F>() };\n \n- T::unbind(pdev, data);\n+ <F::Of<'_> as Driver<'_>>::unbind(pdev, data);\n }\n }\n \n /// Declares a kernel module that exposes a single PCI driver.\n ///\n+/// The `type` field accepts a driver type, optionally with a lifetime placeholder `'_` for\n+/// lifetime-parameterized drivers. The macro wraps it in [`ForLt!`] automatically.\n+///\n /// # Examples\n ///\n ///```ignore\n@@ -152,10 +170,16 @@ extern \"C\" fn remove_callback(pdev: *mut bindings::pci_dev) {\n /// license: \"GPL v2\",\n /// }\n ///```\n+///\n+/// [`ForLt!`]: macro@ForLt\n+/// [`ForLt`]: trait@ForLt\n #[macro_export]\n macro_rules! module_pci_driver {\n-($($f:tt)*) => {\n- $crate::module_driver!(<T>, $crate::pci::Adapter<T>, { $($f)* });\n+(type: $type:ty, $($rest:tt)*) => {\n+ $crate::module_driver!(<T>, $crate::pci::Adapter<T>, {\n+ type: $crate::types::ForLt!($type),\n+ $($rest)*\n+ });\n };\n }\n \n@@ -261,6 +285,9 @@ macro_rules! pci_device_table {\n \n /// The PCI driver trait.\n ///\n+/// Drivers implement this trait with a lifetime parameter `'a` that ties device resources to the\n+/// device scope.\n+///\n /// # Examples\n ///\n ///```\n@@ -271,7 +298,7 @@ macro_rules! pci_device_table {\n /// kernel::pci_device_table!(\n /// PCI_TABLE,\n /// MODULE_PCI_TABLE,\n-/// <MyDriver as pci::Driver>::IdInfo,\n+/// <MyDriver as pci::Driver<'_>>::IdInfo,\n /// [\n /// (\n /// pci::DeviceId::from_id(pci::Vendor::REDHAT, bindings::PCI_ANY_ID as u32),\n@@ -280,21 +307,22 @@ macro_rules! pci_device_table {\n /// ]\n /// );\n ///\n-/// impl pci::Driver for MyDriver {\n+/// impl<'a> pci::Driver<'a> for MyDriver {\n /// type IdInfo = ();\n /// const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;\n ///\n /// fn probe(\n-/// _pdev: &pci::Device<Core>,\n-/// _id_info: &Self::IdInfo,\n-/// ) -> impl PinInit<Self, Error> {\n+/// _pdev: &'a pci::Device<Core>,\n+/// _id_info: &'a Self::IdInfo,\n+/// ) -> impl PinInit<Self, Error> + 'a {\n /// Err(ENODEV)\n /// }\n /// }\n ///```\n+///\n /// Drivers must implement this trait in order to get a PCI driver registered. Please refer to the\n /// `Adapter` documentation for an example.\n-pub trait Driver: Send {\n+pub trait Driver<'a>: Send {\n /// The type holding information about each device id supported by the driver.\n // TODO: Use `associated_type_defaults` once stabilized:\n //\n@@ -310,7 +338,10 @@ pub trait Driver: Send {\n ///\n /// Called when a new pci device is added or discovered. Implementers should\n /// attempt to initialize the device here.\n- fn probe(dev: &Device<device::Core>, id_info: &Self::IdInfo) -> impl PinInit<Self, Error>;\n+ fn probe(\n+ dev: &'a Device<device::Core>,\n+ id_info: &'a Self::IdInfo,\n+ ) -> impl PinInit<Self, Error> + 'a;\n \n /// PCI driver unbind.\n ///\n@@ -322,7 +353,7 @@ pub trait Driver: Send {\n /// operations to gracefully tear down the device.\n ///\n /// Otherwise, release operations for driver resources should be performed in `Self::drop`.\n- fn unbind(dev: &Device<device::Core>, this: Pin<&Self>) {\n+ fn unbind(dev: &'a Device<device::Core>, this: Pin<&'a Self>) {\n let _ = (dev, this);\n }\n }\ndiff --git a/samples/rust/rust_dma.rs b/samples/rust/rust_dma.rs\nindex 129bb4b39c04..8b6f8c923049 100644\n--- a/samples/rust/rust_dma.rs\n+++ b/samples/rust/rust_dma.rs\n@@ -52,15 +52,18 @@ unsafe impl kernel::transmute::FromBytes for MyStruct {}\n kernel::pci_device_table!(\n PCI_TABLE,\n MODULE_PCI_TABLE,\n- <DmaSampleDriver as pci::Driver>::IdInfo,\n+ <DmaSampleDriver as pci::Driver<'_>>::IdInfo,\n [(pci::DeviceId::from_id(pci::Vendor::REDHAT, 0x5), ())]\n );\n \n-impl pci::Driver for DmaSampleDriver {\n+impl<'a> pci::Driver<'a> for DmaSampleDriver {\n type IdInfo = ();\n const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;\n \n- fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {\n+ fn probe(\n+ pdev: &'a pci::Device<Core>,\n+ _info: &'a Self::IdInfo,\n+ ) -> impl PinInit<Self, Error> + 'a {\n pin_init::pin_init_scope(move || {\n dev_info!(pdev, \"Probe DMA test driver.\\n\");\n \ndiff --git a/samples/rust/rust_driver_auxiliary.rs b/samples/rust/rust_driver_auxiliary.rs\nindex 319ef734c02b..f57b2b03adb6 100644\n--- a/samples/rust/rust_driver_auxiliary.rs\n+++ b/samples/rust/rust_driver_auxiliary.rs\n@@ -14,6 +14,7 @@\n driver,\n pci,\n prelude::*,\n+ types::ForLt,\n InPlaceModule, //\n };\n \n@@ -59,16 +60,19 @@ struct ParentDriver {\n kernel::pci_device_table!(\n PCI_TABLE,\n MODULE_PCI_TABLE,\n- <ParentDriver as pci::Driver>::IdInfo,\n+ <ParentDriver as pci::Driver<'_>>::IdInfo,\n [(pci::DeviceId::from_id(pci::Vendor::REDHAT, 0x5), ())]\n );\n \n-impl pci::Driver for ParentDriver {\n+impl<'a> pci::Driver<'a> for ParentDriver {\n type IdInfo = ();\n \n const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;\n \n- fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {\n+ fn probe(\n+ pdev: &'a pci::Device<Core>,\n+ _info: &'a Self::IdInfo,\n+ ) -> impl PinInit<Self, Error> + 'a {\n Ok(Self {\n _reg0: auxiliary::Registration::new(\n pdev.as_ref(),\n@@ -116,7 +120,8 @@ fn connect(adev: &auxiliary::Device<Bound>) -> Result {\n #[pin_data]\n struct SampleModule {\n #[pin]\n- _pci_driver: driver::Registration<pci::Adapter<ParentDriver>>,\n+ #[allow(clippy::type_complexity)]\n+ _pci_driver: driver::Registration<pci::Adapter<ForLt!(ParentDriver)>>,\n #[pin]\n _aux_driver: driver::Registration<auxiliary::Adapter<AuxiliaryDriver>>,\n }\ndiff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs\nindex 47d3e84fab63..2747beecb5fd 100644\n--- a/samples/rust/rust_driver_pci.rs\n+++ b/samples/rust/rust_driver_pci.rs\n@@ -77,7 +77,7 @@ struct SampleDriver {\n kernel::pci_device_table!(\n PCI_TABLE,\n MODULE_PCI_TABLE,\n- <SampleDriver as pci::Driver>::IdInfo,\n+ <SampleDriver as pci::Driver<'_>>::IdInfo,\n [(\n pci::DeviceId::from_id(pci::Vendor::REDHAT, 0x5),\n TestIndex::NO_EVENTFD\n@@ -138,12 +138,15 @@ fn config_space(pdev: &pci::Device<Bound>) {\n }\n }\n \n-impl pci::Driver for SampleDriver {\n+impl<'a> pci::Driver<'a> for SampleDriver {\n type IdInfo = TestIndex;\n \n const ID_TABLE: pci::IdTable<Self::IdInfo> = &PCI_TABLE;\n \n- fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> impl PinInit<Self, Error> {\n+ fn probe(\n+ pdev: &'a pci::Device<Core>,\n+ info: &'a Self::IdInfo,\n+ ) -> impl PinInit<Self, Error> + 'a {\n pin_init::pin_init_scope(move || {\n let vendor = pdev.vendor_id();\n dev_dbg!(\n@@ -174,7 +177,7 @@ fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> impl PinInit<Self, Er\n })\n }\n \n- fn unbind(pdev: &pci::Device<Core>, this: Pin<&Self>) {\n+ fn unbind(pdev: &'a pci::Device<Core>, this: Pin<&'a Self>) {\n if let Ok(bar) = this.bar.access(pdev.as_ref()) {\n // Reset pci-testdev by writing a new test index.\n bar.write_reg(regs::TEST::zeroed().with_index(this.index));\n", "prefixes": [ "11/24" ] }