Re: [PATCH v4 2/4] samples: rust: Provide example using the new Rust MiscDevice abstraction
From: Arnd Bergmann
Date: Fri Dec 06 2024 - 05:05:30 EST
On Fri, Dec 6, 2024, at 10:05, Lee Jones wrote:
> This sample driver demonstrates the following basic operations:
>
> * Register a Misc Device
> * Create /dev/rust-misc-device
> * Provide open call-back for the aforementioned character device
> * Operate on the character device via a simple ioctl()
> * Provide close call-back for the character device
>
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Could you include a compat_ioctl() callback in the example?
I think it would be good to include it as a reminder for
authors of actual drivers that every driver implementing
ioctl should also implement compat_ioctl. In C drivers, this
can usually be done by pointing .compat_ioctl() to the
generic compat_ptr_ioctl() function, which assumes that 'arg'
is a pointer disguised as an 'unsigned long'.
Arnd