[PATCH 3/4] pwm: th1520: Use module_pwm_platform_driver! macro

Michal Wilczynski posted 4 patches 3 months, 2 weeks ago
[PATCH 3/4] pwm: th1520: Use module_pwm_platform_driver! macro
Posted by Michal Wilczynski 3 months, 2 weeks ago
The `pwm_th1520` Rust driver calls C functions from the `PWM` namespace,
triggering `modpost` warnings due to missing namespace import
declarations in its `.modinfo` section.

Fix these warnings and simplify the module declaration by switching from
the generic `kernel::module_platform_driver!` macro to the newly
introduced PWM-specific `kernel::module_pwm_platform_driver!` macro.
The new macro automatically handles the required `imports_ns: ["PWM"]`
declaration.

Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
 drivers/pwm/pwm_th1520.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm_th1520.rs b/drivers/pwm/pwm_th1520.rs
index 0ad38b78be854ab3c10268fb20763d9962f59c0f..5fb123f5e9c6dc3a8ee9a7a47fa778c23213e957 100644
--- a/drivers/pwm/pwm_th1520.rs
+++ b/drivers/pwm/pwm_th1520.rs
@@ -369,7 +369,7 @@ fn probe(
     }
 }
 
-kernel::module_platform_driver! {
+kernel::module_pwm_platform_driver! {
     type: Th1520PwmPlatformDriver,
     name: "pwm-th1520",
     authors: ["Michal Wilczynski <m.wilczynski@samsung.com>"],

-- 
2.34.1
Re: [PATCH 3/4] pwm: th1520: Use module_pwm_platform_driver! macro
Posted by Troy Mitchell 3 months, 2 weeks ago
On Tue, Oct 28, 2025 at 01:22:34PM +0100, Michal Wilczynski wrote:
> The `pwm_th1520` Rust driver calls C functions from the `PWM` namespace,
> triggering `modpost` warnings due to missing namespace import
> declarations in its `.modinfo` section.
> 
> Fix these warnings and simplify the module declaration by switching from
> the generic `kernel::module_platform_driver!` macro to the newly
> introduced PWM-specific `kernel::module_pwm_platform_driver!` macro.
> The new macro automatically handles the required `imports_ns: ["PWM"]`
> declaration.
> 
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.dev>
Re: [PATCH 3/4] pwm: th1520: Use module_pwm_platform_driver! macro
Posted by Elle Rhumsaa 3 months, 2 weeks ago
On Tue, Oct 28, 2025 at 01:22:34PM +0100, Michal Wilczynski wrote:
> Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
> ---

Reviewed-by: Elle Rhumsaa <elle@weathered-steel.dev>