Re: [PATCH 2/2] device: rust: change the name function

From: gregkh@xxxxxxxxxxxxxxxxxxx
Date: Mon Sep 30 2024 - 08:28:16 EST


On Mon, Sep 30, 2024 at 02:11:37PM +0200, Danilo Krummrich wrote:
> On Mon, Sep 30, 2024 at 01:35:09PM +0200, gregkh@xxxxxxxxxxxxxxxxxxx wrote:
> >
> > > /// While not officially documented, this should be the case for
> > > any `struct device`.
> > > - pub unsafe fn from_raw(ptr: *mut bindings::device) -> ARef<Self> {
> > > + pub unsafe fn get_device(ptr: *mut bindings::device) -> ARef<Self> {
> >
> > With this change, nothing broke? Does nothing call this code yet? I
> > thought the firmware interface did that, but I could be wrong...
>
> The firmware code uses the `Device` structure, but it doesn't create a
> reference from a raw pointer.
>
> This function should probably only ever be called from bus abstractions. I
> thought the PHY layer needed this urgently (which also was the reason we merged
> it already), so I'd expect the PHY code to use it.
>
> Though, they might just use `as_ref`.

Ah, then no harm in renaming it now, great!

When it's resent in a way we can apply it, I'll be glad to queue it up.

thanks,

greg k-h