[PATCH v2 v2 0/1] Implement generic accessors for the platform data of a device

pengfuyuan posted 1 patch 1 month ago
rust/kernel/device.rs | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
[PATCH v2 v2 0/1] Implement generic accessors for the platform data of a device
Posted by pengfuyuan 1 month ago
This is version 2 of the platform data accessor patch series.

Changes since v1:
- Changed return type from &T to &Opaque<T> as suggested by Danilo
- Marked the function as unsafe due to type mismatch risks (no runtime type checking)
- Made the API available for all device states, not just Device<Bound>
- Fixed documentation to use the standard "Safety" section
- Rewrote safety comments to explain why the conditions are upheld

Other notes:
1. AI usage disclosure: Yes, I used AI tools to assist with writing documentation 
   comments and analyzing existing Rust for Linux code patterns. The code 
   implementation itself was written by me, but I should have disclosed the AI 
   assistance. I will ensure proper disclosure in future submissions.

Thanks to Miguel Ojeda and Danilo for their detailed feedback.

Regarding the user/driver:
- The driver we're developing (a simplefb-like display driver) will indeed use 
  this API. Given the API needs redesign based on your feedback, I've redesigned 
  and resubmitted the platform data accessor API.
- However, since the driver is still under active development, it's not yet ready 
  for submission. I understand Linux kernel development requires no speculative 
  APIs (APIs must have actual users). I hope you could review this implementation 
  for feasibility (without merging it for now). If acceptable, I'll continue 
  driver development based on this API and submit both together once the driver 
  is complete.

Thank you again for your detailed review.

pengfuyuan (1):
  rust: device: add platdata accessors

 rust/kernel/device.rs | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

-- 
2.25.1