summaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2024-12-19 18:04:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-12-20 17:19:25 +0100
commitea7e18289f44b0aa597026f16e7f4f6daa0f13ee (patch)
tree3d76a00e48548d0cfdc4ea32b6761d405b85e38c /rust/helpers/helpers.c
parenta790265c7f663c382ac25ecb841e241a023f0590 (diff)
downloadlinux-ea7e18289f44b0aa597026f16e7f4f6daa0f13ee.tar.gz
linux-ea7e18289f44b0aa597026f16e7f4f6daa0f13ee.tar.bz2
linux-ea7e18289f44b0aa597026f16e7f4f6daa0f13ee.zip
rust: implement generic driver registration
Implement the generic `Registration` type and the `RegistrationOps` trait. The `Registration` structure is the common type that represents a driver registration and is typically bound to the lifetime of a module. However, it doesn't implement actual calls to the kernel's driver core to register drivers itself. Instead the `RegistrationOps` trait is provided to subsystems, which have to implement `RegistrationOps::register` and `RegistrationOps::unregister`. Subsystems have to provide an implementation for both of those methods where the subsystem specific variants to register / unregister a driver have to implemented. For instance, the PCI subsystem would call __pci_register_driver() from `RegistrationOps::register` and pci_unregister_driver() from `DrvierOps::unregister`. Co-developed-by: Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Tested-by: Dirk Behme <dirk.behme@de.bosch.com> Tested-by: Fabien Parent <fabien.parent@linaro.org> Link: https://lore.kernel.org/r/20241219170425.12036-3-dakr@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions