With device ID info now including pointers instead of indices, the open-coded ACPI/OF matching is no longer needed and can be replaced with `device_get_match_data`. With the removal of open-coded matching, the exposed functions and helpers are also removed; this effectively reverts most of commit 2690d071584e ("rust: ACPI: fix missing match data for PRP0001").
Showing the changes to rust/kernel/serdev.rs (1 of 9 files). Show all
Unified · Split
| @@ -162,7 +162,8 @@ impl<T: Driver> Adapter<T> { · 161 unmodified lines | ||
| 162 | 162 | // |
| 163 | 163 | // INVARIANT: `sdev` is valid for the duration of `probe_callback()`. |
| 164 | 164 | let sdev = unsafe { &*sdev.cast::<Device<device::CoreInternal<'_>>>() }; |
| 165 | − let info = <Self as driver::Adapter>::id_info(sdev.as_ref()); | |
| 165 | + // SAFETY: `sdev` matched data is of type `Self::IdInfo`. | |
| 166 | + let info = unsafe { <Self as driver::Adapter>::id_info(sdev.as_ref()) }; | |
| 166 | 167 | |
| 167 | 168 | from_result(|| { |
| 168 | 169 | sdev.as_ref().set_drvdata(try_pin_init!(PrivateData::<T> { |