mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Merge tag 'char-misc-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc/IIO driver updates from Greg KH: "Here is the big set of char/misc/iio and other smaller driver subsystem changes for 7.0-rc1. Lots of little things in here, including: - Loads of iio driver changes and updates and additions - gpib driver updates - interconnect driver updates - i3c driver updates - hwtracing (coresight and intel) driver updates - deletion of the obsolete mwave driver - binder driver updates (rust and c versions) - mhi driver updates (causing a merge conflict, see below) - mei driver updates - fsi driver updates - eeprom driver updates - lots of other small char and misc driver updates and cleanups All of these have been in linux-next for a while, with no reported issues" * tag 'char-misc-7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (297 commits) mux: mmio: fix regmap leak on probe failure rust_binder: return p from rust_binder_transaction_target_node() drivers: android: binder: Update ARef imports from sync::aref rust_binder: fix needless borrow in context.rs iio: magn: mmc5633: Fix Kconfig for combination of I3C as module and driver builtin iio: sca3000: Fix a resource leak in sca3000_probe() iio: proximity: rfd77402: Add interrupt handling support iio: proximity: rfd77402: Document device private data structure iio: proximity: rfd77402: Use devm-managed mutex initialization iio: proximity: rfd77402: Use kernel helper for result polling iio: proximity: rfd77402: Align polling timeout with datasheet iio: cros_ec: Allow enabling/disabling calibration mode iio: frequency: ad9523: correct kernel-doc bad line warning iio: buffer: buffer_impl.h: fix kernel-doc warnings iio: gyro: itg3200: Fix unchecked return value in read_raw MAINTAINERS: add entry for ADE9000 driver iio: accel: sca3000: remove unused last_timestamp field iio: accel: adxl372: remove unused int2_bitmask field iio: adc: ad7766: Use iio_trigger_generic_data_rdy_poll() iio: magnetometer: Remove IRQF_ONESHOT ...
This commit is contained in:
@@ -67,3 +67,16 @@ mod bindings_helper {
|
||||
}
|
||||
|
||||
pub use bindings_raw::*;
|
||||
|
||||
pub const compat_ptr_ioctl: Option<
|
||||
unsafe extern "C" fn(*mut file, ffi::c_uint, ffi::c_ulong) -> ffi::c_long,
|
||||
> = {
|
||||
#[cfg(CONFIG_COMPAT)]
|
||||
{
|
||||
Some(bindings_raw::compat_ptr_ioctl)
|
||||
}
|
||||
#[cfg(not(CONFIG_COMPAT))]
|
||||
{
|
||||
None
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,20 +7,21 @@
|
||||
#include <linux/list_lru.h>
|
||||
#include <linux/task_work.h>
|
||||
|
||||
unsigned long rust_helper_list_lru_count(struct list_lru *lru)
|
||||
__rust_helper unsigned long rust_helper_list_lru_count(struct list_lru *lru)
|
||||
{
|
||||
return list_lru_count(lru);
|
||||
}
|
||||
|
||||
unsigned long rust_helper_list_lru_walk(struct list_lru *lru,
|
||||
list_lru_walk_cb isolate, void *cb_arg,
|
||||
unsigned long nr_to_walk)
|
||||
__rust_helper unsigned long rust_helper_list_lru_walk(struct list_lru *lru,
|
||||
list_lru_walk_cb isolate,
|
||||
void *cb_arg,
|
||||
unsigned long nr_to_walk)
|
||||
{
|
||||
return list_lru_walk(lru, isolate, cb_arg, nr_to_walk);
|
||||
}
|
||||
|
||||
void rust_helper_init_task_work(struct callback_head *twork,
|
||||
task_work_func_t func)
|
||||
__rust_helper void rust_helper_init_task_work(struct callback_head *twork,
|
||||
task_work_func_t func)
|
||||
{
|
||||
init_task_work(twork, func);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::{
|
||||
seq_file::SeqFile,
|
||||
types::{ForeignOwnable, Opaque},
|
||||
};
|
||||
use core::{marker::PhantomData, mem::MaybeUninit, pin::Pin};
|
||||
use core::{marker::PhantomData, pin::Pin};
|
||||
|
||||
/// Options for creating a misc device.
|
||||
#[derive(Copy, Clone)]
|
||||
@@ -32,8 +32,7 @@ pub struct MiscDeviceOptions {
|
||||
impl MiscDeviceOptions {
|
||||
/// Create a raw `struct miscdev` ready for registration.
|
||||
pub const fn into_raw<T: MiscDevice>(self) -> bindings::miscdevice {
|
||||
// SAFETY: All zeros is valid for this C type.
|
||||
let mut result: bindings::miscdevice = unsafe { MaybeUninit::zeroed().assume_init() };
|
||||
let mut result: bindings::miscdevice = pin_init::zeroed();
|
||||
result.minor = bindings::MISC_DYNAMIC_MINOR as ffi::c_int;
|
||||
result.name = crate::str::as_char_ptr_in_const_context(self.name);
|
||||
result.fops = MiscdeviceVTable::<T>::build();
|
||||
@@ -411,7 +410,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> {
|
||||
compat_ioctl: if T::HAS_COMPAT_IOCTL {
|
||||
Some(Self::compat_ioctl)
|
||||
} else if T::HAS_IOCTL {
|
||||
Some(bindings::compat_ptr_ioctl)
|
||||
bindings::compat_ptr_ioctl
|
||||
} else {
|
||||
None
|
||||
},
|
||||
@@ -420,8 +419,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> {
|
||||
} else {
|
||||
None
|
||||
},
|
||||
// SAFETY: All zeros is a valid value for `bindings::file_operations`.
|
||||
..unsafe { MaybeUninit::zeroed().assume_init() }
|
||||
..pin_init::zeroed()
|
||||
};
|
||||
|
||||
const fn build() -> &'static bindings::file_operations {
|
||||
|
||||
@@ -240,6 +240,9 @@ impl<T> Arc<T> {
|
||||
// `Arc` object.
|
||||
Ok(unsafe { Self::from_inner(inner) })
|
||||
}
|
||||
|
||||
/// The offset that the value is stored at.
|
||||
pub const DATA_OFFSET: usize = core::mem::offset_of!(ArcInner<T>, data);
|
||||
}
|
||||
|
||||
impl<T: ?Sized> Arc<T> {
|
||||
|
||||
Reference in New Issue
Block a user