linux/rust
Guilherme Giacomo Simoes cc4332afb5 rust: device: change the from_raw() function
The function Device::from_raw() increments a refcount by a call to
bindings::get_device(ptr). This can be confused because usually
from_raw() functions don't increment a refcount.
Hence, rename Device::from_raw() to avoid confuion with other "from_raw"
semantics.

The new name of function should be "get_device" to be consistent with
the function get_device() already exist in .c files.

This function body also changed, because the `into()` will convert the
`&'a Device` into `ARef<Device>` and also call `inc_ref` from the
`AlwaysRefCounted` trait implemented for Device.

Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1088
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20241001205603.106278-1-trintaeoitogc@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-03 13:54:48 +02:00
..
bindings rust: sort blk includes in bindings_helper.h 2024-08-21 00:37:02 +02:00
helpers rust: rbtree: add red-black tree implementation backed by the C version 2024-08-31 17:35:08 +02:00
kernel rust: device: change the from_raw() function 2024-10-03 13:54:48 +02:00
macros Rust changes for v6.12 2024-09-25 10:25:40 -07:00
uapi rust: net::phy unified read/write API for C22 and C45 registers 2024-08-30 10:27:35 +01:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
bindgen_parameters rust: Ignore preserve-most functions 2023-12-13 01:09:55 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: add intrinsics to fix -Os builds 2024-08-10 00:05:10 +02:00
exports.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
Makefile Rust changes for v6.12 2024-09-25 10:25:40 -07:00