[PATCH v2 14/27] rust: pwm: add __rust_helper to helpers

Alice Ryhl posted 27 patches 1 month ago
[PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: linux-pwm@vger.kernel.org
---
 rust/helpers/pwm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust/helpers/pwm.c b/rust/helpers/pwm.c
index d75c588863685d3990b525bb1b84aa4bc35ac397..eb24d2ea8e748364f3e17dccbb6a92fd7f2514c0 100644
--- a/rust/helpers/pwm.c
+++ b/rust/helpers/pwm.c
@@ -4,17 +4,17 @@
 
 #include <linux/pwm.h>
 
-struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip)
+__rust_helper struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip)
 {
 	return pwmchip_parent(chip);
 }
 
-void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip)
+__rust_helper void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip)
 {
 	return pwmchip_get_drvdata(chip);
 }
 
-void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
+__rust_helper void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
 {
 	pwmchip_set_drvdata(chip, data);
 }

-- 
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
Posted by Uwe Kleine-König 2 weeks, 4 days ago
Hello,

On Mon, Jan 05, 2026 at 12:42:27PM +0000, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Michal Wilczynski <m.wilczynski@samsung.com>
> Cc: linux-pwm@vger.kernel.org

Applied this patch to
	https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
as merge window material.

Best regards
Uwe
Re: [PATCH v2 14/27] rust: pwm: add __rust_helper to helpers
Posted by Michal Wilczynski 1 month ago

On 1/5/26 13:42, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
> 
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Cc: Michal Wilczynski <m.wilczynski@samsung.com>
> Cc: linux-pwm@vger.kernel.org
> ---
>  rust/helpers/pwm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/rust/helpers/pwm.c b/rust/helpers/pwm.c
> index d75c588863685d3990b525bb1b84aa4bc35ac397..eb24d2ea8e748364f3e17dccbb6a92fd7f2514c0 100644
> --- a/rust/helpers/pwm.c
> +++ b/rust/helpers/pwm.c
> @@ -4,17 +4,17 @@
>  
>  #include <linux/pwm.h>
>  
> -struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip)
> +__rust_helper struct device *rust_helper_pwmchip_parent(const struct pwm_chip *chip)
>  {
>  	return pwmchip_parent(chip);
>  }
>  
> -void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip)
> +__rust_helper void *rust_helper_pwmchip_get_drvdata(struct pwm_chip *chip)
>  {
>  	return pwmchip_get_drvdata(chip);
>  }
>  
> -void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
> +__rust_helper void rust_helper_pwmchip_set_drvdata(struct pwm_chip *chip, void *data)
>  {
>  	pwmchip_set_drvdata(chip, data);
>  }
> 

Acked-by: Michal Wilczynski <m.wilczynski@samsung.com>