Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: clk: add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-4-51da5f454a67@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Alice Ryhl and committed by
Miguel Ojeda
15536a3b 1f318b96

+13 -11
+13 -11
rust/helpers/clk.c
··· 7 7 * CONFIG_HAVE_CLK or CONFIG_HAVE_CLK_PREPARE aren't set. 8 8 */ 9 9 #ifndef CONFIG_HAVE_CLK 10 - struct clk *rust_helper_clk_get(struct device *dev, const char *id) 10 + __rust_helper struct clk *rust_helper_clk_get(struct device *dev, 11 + const char *id) 11 12 { 12 13 return clk_get(dev, id); 13 14 } 14 15 15 - void rust_helper_clk_put(struct clk *clk) 16 + __rust_helper void rust_helper_clk_put(struct clk *clk) 16 17 { 17 18 clk_put(clk); 18 19 } 19 20 20 - int rust_helper_clk_enable(struct clk *clk) 21 + __rust_helper int rust_helper_clk_enable(struct clk *clk) 21 22 { 22 23 return clk_enable(clk); 23 24 } 24 25 25 - void rust_helper_clk_disable(struct clk *clk) 26 + __rust_helper void rust_helper_clk_disable(struct clk *clk) 26 27 { 27 28 clk_disable(clk); 28 29 } 29 30 30 - unsigned long rust_helper_clk_get_rate(struct clk *clk) 31 + __rust_helper unsigned long rust_helper_clk_get_rate(struct clk *clk) 31 32 { 32 33 return clk_get_rate(clk); 33 34 } 34 35 35 - int rust_helper_clk_set_rate(struct clk *clk, unsigned long rate) 36 + __rust_helper int rust_helper_clk_set_rate(struct clk *clk, unsigned long rate) 36 37 { 37 38 return clk_set_rate(clk, rate); 38 39 } 39 40 #endif 40 41 41 42 #ifndef CONFIG_HAVE_CLK_PREPARE 42 - int rust_helper_clk_prepare(struct clk *clk) 43 + __rust_helper int rust_helper_clk_prepare(struct clk *clk) 43 44 { 44 45 return clk_prepare(clk); 45 46 } 46 47 47 - void rust_helper_clk_unprepare(struct clk *clk) 48 + __rust_helper void rust_helper_clk_unprepare(struct clk *clk) 48 49 { 49 50 clk_unprepare(clk); 50 51 } 51 52 #endif 52 53 53 - struct clk *rust_helper_clk_get_optional(struct device *dev, const char *id) 54 + __rust_helper struct clk *rust_helper_clk_get_optional(struct device *dev, 55 + const char *id) 54 56 { 55 57 return clk_get_optional(dev, id); 56 58 } 57 59 58 - int rust_helper_clk_prepare_enable(struct clk *clk) 60 + __rust_helper int rust_helper_clk_prepare_enable(struct clk *clk) 59 61 { 60 62 return clk_prepare_enable(clk); 61 63 } 62 64 63 - void rust_helper_clk_disable_unprepare(struct clk *clk) 65 + __rust_helper void rust_helper_clk_disable_unprepare(struct clk *clk) 64 66 { 65 67 clk_disable_unprepare(clk); 66 68 }