]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: driver: Consolidate `Adapter::of_id_info` methods using `#[cfg]`
authorIgor Korotin <igor.korotin.linux@gmail.com>
Fri, 20 Jun 2025 15:36:56 +0000 (16:36 +0100)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 26 Jun 2025 21:25:07 +0000 (23:25 +0200)
commit0f549d25858dfef9decd0b99a82ff4bc9095a51f
tree0922f6c80538f08a8cbc4162e7cbaef48d427461
parenta74931eb59cf6b914e1b9471d9abd4429176f6af
rust: driver: Consolidate `Adapter::of_id_info` methods using `#[cfg]`

Refactor the `of_id_info` methods in the `Adapter` trait to reduce
duplication. Previously, the method had two versions selected
via `#[cfg(...)]` and `#[cfg(not(...))]`. This change merges them into a
single method by using `#[cfg]` blocks within the method body.

Suggested-by: Benno Lossin <lossin@kernel.org>
Signed-off-by: Igor Korotin <igor.korotin.linux@gmail.com>
Link: https://lore.kernel.org/r/20250620153656.294468-1-igor.korotin.linux@gmail.com
[ Fix clippy warning if #[cfg(not(CONFIG_OF))]; fix checkpatch.pl line
  length warnings. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/driver.rs