Re: [PATCH] rust: device: add platdata accessors
From: Greg Kroah-Hartman
Date: Thu Jan 08 2026 - 03:15:34 EST
On Thu, Jan 08, 2026 at 03:42:51PM +0800, 1064094935@xxxxxx wrote:
> From: pengfuyuan <pengfuyuan@xxxxxxxxxx>
Please use your "real" name (you can use native character sets if
wanted.)
> Implement generic accessors for the platform data of a device.
>
> Platform data is typically set by platform code when creating the device
> and points to platform-specific data structures. The accessor provides
> type-safe access to this data without requiring unsafe code at the call
> site.
>
> The accessor is implemented for Device<Bound>, allowing drivers to access
> platform data during probe() and other device lifecycle callbacks. Unlike
> drvdata, platform data is managed by platform code and has a lifetime
> tied to the device itself.
Do you have a user for this? That would be good to see at the same time
here, we can't just add apis with no real users.
thanks,
greg k-h