Skip to content

Commit 03d281f

Browse files
Darksonnbroonie
authored andcommitted
rust: regulator: add __rust_helper to helpers
This is needed to inline these helpers into Rust code. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20251202-define-rust-helper-v1-35-a2e13cbc17a6@google.com Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8f0b4cc commit 03d281f

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

rust/helpers/regulator.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,52 @@
44

55
#ifndef CONFIG_REGULATOR
66

7-
void rust_helper_regulator_put(struct regulator *regulator)
7+
__rust_helper void rust_helper_regulator_put(struct regulator *regulator)
88
{
99
regulator_put(regulator);
1010
}
1111

12-
int rust_helper_regulator_set_voltage(struct regulator *regulator, int min_uV,
13-
int max_uV)
12+
__rust_helper int rust_helper_regulator_set_voltage(struct regulator *regulator,
13+
int min_uV, int max_uV)
1414
{
1515
return regulator_set_voltage(regulator, min_uV, max_uV);
1616
}
1717

18-
int rust_helper_regulator_get_voltage(struct regulator *regulator)
18+
__rust_helper int rust_helper_regulator_get_voltage(struct regulator *regulator)
1919
{
2020
return regulator_get_voltage(regulator);
2121
}
2222

23-
struct regulator *rust_helper_regulator_get(struct device *dev, const char *id)
23+
__rust_helper struct regulator *rust_helper_regulator_get(struct device *dev,
24+
const char *id)
2425
{
2526
return regulator_get(dev, id);
2627
}
2728

28-
int rust_helper_regulator_enable(struct regulator *regulator)
29+
__rust_helper int rust_helper_regulator_enable(struct regulator *regulator)
2930
{
3031
return regulator_enable(regulator);
3132
}
3233

33-
int rust_helper_regulator_disable(struct regulator *regulator)
34+
__rust_helper int rust_helper_regulator_disable(struct regulator *regulator)
3435
{
3536
return regulator_disable(regulator);
3637
}
3738

38-
int rust_helper_regulator_is_enabled(struct regulator *regulator)
39+
__rust_helper int rust_helper_regulator_is_enabled(struct regulator *regulator)
3940
{
4041
return regulator_is_enabled(regulator);
4142
}
4243

43-
int rust_helper_devm_regulator_get_enable(struct device *dev, const char *id)
44+
__rust_helper int rust_helper_devm_regulator_get_enable(struct device *dev,
45+
const char *id)
4446
{
4547
return devm_regulator_get_enable(dev, id);
4648
}
4749

48-
int rust_helper_devm_regulator_get_enable_optional(struct device *dev, const char *id)
50+
__rust_helper int
51+
rust_helper_devm_regulator_get_enable_optional(struct device *dev,
52+
const char *id)
4953
{
5054
return devm_regulator_get_enable_optional(dev, id);
5155
}

0 commit comments

Comments
 (0)