mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
rust: clk: replace kernel::c_str! with C-Strings
C-String literals were added in Rust 1.77. Replace instances of `kernel::c_str!` with C-String literals where possible. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20251222-cstr-clk-v1-1-ef0687717aa1@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
1e37f6f949
commit
844590b439
1 changed files with 2 additions and 4 deletions
|
|
@ -104,13 +104,12 @@ mod common_clk {
|
|||
/// The following example demonstrates how to obtain and configure a clock for a device.
|
||||
///
|
||||
/// ```
|
||||
/// use kernel::c_str;
|
||||
/// use kernel::clk::{Clk, Hertz};
|
||||
/// use kernel::device::Device;
|
||||
/// use kernel::error::Result;
|
||||
///
|
||||
/// fn configure_clk(dev: &Device) -> Result {
|
||||
/// let clk = Clk::get(dev, Some(c_str!("apb_clk")))?;
|
||||
/// let clk = Clk::get(dev, Some(c"apb_clk"))?;
|
||||
///
|
||||
/// clk.prepare_enable()?;
|
||||
///
|
||||
|
|
@ -272,13 +271,12 @@ mod common_clk {
|
|||
/// device. The code functions correctly whether or not the clock is available.
|
||||
///
|
||||
/// ```
|
||||
/// use kernel::c_str;
|
||||
/// use kernel::clk::{OptionalClk, Hertz};
|
||||
/// use kernel::device::Device;
|
||||
/// use kernel::error::Result;
|
||||
///
|
||||
/// fn configure_clk(dev: &Device) -> Result {
|
||||
/// let clk = OptionalClk::get(dev, Some(c_str!("apb_clk")))?;
|
||||
/// let clk = OptionalClk::get(dev, Some(c"apb_clk"))?;
|
||||
///
|
||||
/// clk.prepare_enable()?;
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue