Skip to content

Commit 15536a3

Browse files
Darksonnojeda
authored andcommitted
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>
1 parent 1f318b9 commit 15536a3

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

rust/helpers/clk.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,60 +7,62 @@
77
* CONFIG_HAVE_CLK or CONFIG_HAVE_CLK_PREPARE aren't set.
88
*/
99
#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)
1112
{
1213
return clk_get(dev, id);
1314
}
1415

15-
void rust_helper_clk_put(struct clk *clk)
16+
__rust_helper void rust_helper_clk_put(struct clk *clk)
1617
{
1718
clk_put(clk);
1819
}
1920

20-
int rust_helper_clk_enable(struct clk *clk)
21+
__rust_helper int rust_helper_clk_enable(struct clk *clk)
2122
{
2223
return clk_enable(clk);
2324
}
2425

25-
void rust_helper_clk_disable(struct clk *clk)
26+
__rust_helper void rust_helper_clk_disable(struct clk *clk)
2627
{
2728
clk_disable(clk);
2829
}
2930

30-
unsigned long rust_helper_clk_get_rate(struct clk *clk)
31+
__rust_helper unsigned long rust_helper_clk_get_rate(struct clk *clk)
3132
{
3233
return clk_get_rate(clk);
3334
}
3435

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)
3637
{
3738
return clk_set_rate(clk, rate);
3839
}
3940
#endif
4041

4142
#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)
4344
{
4445
return clk_prepare(clk);
4546
}
4647

47-
void rust_helper_clk_unprepare(struct clk *clk)
48+
__rust_helper void rust_helper_clk_unprepare(struct clk *clk)
4849
{
4950
clk_unprepare(clk);
5051
}
5152
#endif
5253

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)
5456
{
5557
return clk_get_optional(dev, id);
5658
}
5759

58-
int rust_helper_clk_prepare_enable(struct clk *clk)
60+
__rust_helper int rust_helper_clk_prepare_enable(struct clk *clk)
5961
{
6062
return clk_prepare_enable(clk);
6163
}
6264

63-
void rust_helper_clk_disable_unprepare(struct clk *clk)
65+
__rust_helper void rust_helper_clk_disable_unprepare(struct clk *clk)
6466
{
6567
clk_disable_unprepare(clk);
6668
}

0 commit comments

Comments
 (0)