mirror-linux/drivers/gpu/nova-core
Danilo Krummrich 0242623384 rust: driver: let probe() return impl PinInit<Self, Error>
The driver model defines the lifetime of the private data stored in (and
owned by) a bus device to be valid from when the driver is bound to a
device (i.e. from successful probe()) until the driver is unbound from
the device.

This is already taken care of by the Rust implementation of the driver
model. However, we still ask drivers to return a Result<Pin<KBox<Self>>>
from probe().

Unlike in C, where we do not have the concept of initializers, but
rather deal with uninitialized memory, drivers can just return an
impl PinInit<Self, Error> instead.

This contributes to more clarity to the fact that a driver returns it's
device private data in probe() and the Rust driver model owns the data,
manages the lifetime and - considering the lifetime - provides (safe)
accessors for the driver.

Hence, let probe() functions return an impl PinInit<Self, Error> instead
of Result<Pin<KBox<Self>>>.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2025-10-21 18:40:48 +02:00
..
falcon gpu: nova-core: require `Send` on `FalconEngine` and `FalconHal` 2025-09-13 23:17:18 +09:00
fb gpu: nova-core: consider `clippy::cast_lossless` 2025-06-25 01:17:22 +02:00
firmware gpu: nova-core: firmware: process the GSP bootloader 2025-09-13 23:17:42 +09:00
gsp gpu: nova-core: Add base files for r570.144 firmware bindings 2025-09-13 23:17:48 +09:00
regs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00
Kconfig gpu: nova-core: depend on CONFIG_64BIT 2025-09-01 11:06:37 +02:00
Makefile
dma.rs gpu: nova-core: update and annotate TODO list 2025-06-23 22:05:41 +02:00
driver.rs rust: driver: let probe() return impl PinInit<Self, Error> 2025-10-21 18:40:48 +02:00
falcon.rs gpu: nova-core: firmware: process Booter and patch its signature 2025-09-13 23:17:34 +09:00
fb.rs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00
firmware.rs gpu: nova-core: firmware: use 570.144 firmware 2025-09-13 23:17:45 +09:00
gfw.rs gpu: nova-core: Add code comments related to devinit 2025-07-09 00:07:34 +02:00
gpu.rs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00
gsp.rs gpu: nova-core: Add base files for r570.144 firmware bindings 2025-09-13 23:17:48 +09:00
nova_core.rs gpu: nova-core: move GSP boot code to its own module 2025-09-13 23:17:21 +09:00
regs.rs gpu: nova-core: register: add support for relative array registers 2025-08-15 12:02:56 +09:00
util.rs gpu: nova-core: add Chipset::name() method 2025-09-13 23:17:24 +09:00
vbios.rs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00