diff options
| author | Shashank Balaji <shashank.mahadasyam@sony.com> | 2026-05-18 19:20:00 +0900 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-06-08 23:28:24 +0200 |
| commit | a7a7dc5c46a036e8a581a4269839d92aded0e0ea (patch) | |
| tree | a0661fc0afa0be85986402a4606722b7a1db3fa8 /rust | |
| parent | efc22b3f89a3cab9a779f604ef66e7b9c3bfaa72 (diff) | |
| download | linux-a7a7dc5c46a036e8a581a4269839d92aded0e0ea.tar.gz linux-a7a7dc5c46a036e8a581a4269839d92aded0e0ea.zip | |
driver core: platform: set mod_name in driver registration
Pass KBUILD_MODNAME through the driver registration macro so that the
driver core can create the module symlink in sysfs for built-in drivers,
and fixup all callers.
The Rust platform adapter is updated to pass the module name through to
the new parameter.
Tested on qemu with:
- x86 defconfig + CONFIG_RUST
- arm64 defconfig + CONFIG_RUST + CONFIG_CORESIGHT stuff
Examples after this patch:
/sys/bus/platform/drivers/...
coresight-itnoc/module -> coresight_tnoc
coresight-static-tpdm/module -> coresight_tpdm
coresight-catu-platform/module -> coresight_catu
serial8250/module -> 8250
acpi-ged/module -> acpi
vmclock/module -> ptp_vmclock
Co-developed-by: Rahul Bukte <rahul.bukte@sony.com>
Signed-off-by: Rahul Bukte <rahul.bukte@sony.com>
Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com>
Link: https://patch.msgid.link/20260518-acpi_mod_name-v5-4-705ccc430885@sony.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/kernel/platform.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs index d8d48f60b0b9..9b362e0495d3 100644 --- a/rust/kernel/platform.rs +++ b/rust/kernel/platform.rs @@ -82,7 +82,9 @@ unsafe impl<T: Driver> driver::RegistrationOps for Adapter<T> { } // SAFETY: `pdrv` is guaranteed to be a valid `DriverType`. - to_result(unsafe { bindings::__platform_driver_register(pdrv.get(), module.0) }) + to_result(unsafe { + bindings::__platform_driver_register(pdrv.get(), module.0, name.as_char_ptr()) + }) } unsafe fn unregister(pdrv: &Opaque<Self::DriverType>) { |
