mirror of
https://github.com/torvalds/linux.git
synced 2026-01-12 00:42:35 +08:00
Merge tag 'driver-core-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core
Pull driver core fixes from Danilo Krummrich: - Fix swapped example values for the `family` and `machine` attributes in the sysfs SoC bus ABI documentation - Fix Rust build and intra-doc issues when optional subsystems (CONFIG_PCI, CONFIG_AUXILIARY_BUS, CONFIG_PRINTK) are disabled - Fix typos and incorrect safety comments in Rust PCI, DMA, and device ID documentation * tag 'driver-core-6.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core: rust: device: Remove explicit import of CStrExt rust: pci: fix typos in Bar struct's comments rust: device: fix broken intra-doc links rust: dma: fix broken intra-doc links rust: driver: fix broken intra-doc links to example driver types rust: device_id: replace incorrect word in safety documentation rust: dma: remove incorrect safety documentation docs: ABI: sysfs-devices-soc: Fix swapped sample values
This commit is contained in:
@@ -17,14 +17,14 @@ Date: January 2012
|
|||||||
contact: Lee Jones <lee@kernel.org>
|
contact: Lee Jones <lee@kernel.org>
|
||||||
Description:
|
Description:
|
||||||
Read-only attribute common to all SoCs. Contains the SoC machine
|
Read-only attribute common to all SoCs. Contains the SoC machine
|
||||||
name (e.g. Ux500).
|
name (e.g. DB8500).
|
||||||
|
|
||||||
What: /sys/devices/socX/family
|
What: /sys/devices/socX/family
|
||||||
Date: January 2012
|
Date: January 2012
|
||||||
contact: Lee Jones <lee@kernel.org>
|
contact: Lee Jones <lee@kernel.org>
|
||||||
Description:
|
Description:
|
||||||
Read-only attribute common to all SoCs. Contains SoC family name
|
Read-only attribute common to all SoCs. Contains SoC family name
|
||||||
(e.g. DB8500).
|
(e.g. ux500).
|
||||||
|
|
||||||
On many of ARM based silicon with SMCCC v1.2+ compliant firmware
|
On many of ARM based silicon with SMCCC v1.2+ compliant firmware
|
||||||
this will contain the JEDEC JEP106 manufacturer’s identification
|
this will contain the JEDEC JEP106 manufacturer’s identification
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ use core::{any::TypeId, marker::PhantomData, ptr};
|
|||||||
|
|
||||||
#[cfg(CONFIG_PRINTK)]
|
#[cfg(CONFIG_PRINTK)]
|
||||||
use crate::c_str;
|
use crate::c_str;
|
||||||
use crate::str::CStrExt as _;
|
|
||||||
|
|
||||||
pub mod property;
|
pub mod property;
|
||||||
|
|
||||||
@@ -67,8 +66,9 @@ static_assert!(core::mem::size_of::<bindings::driver_type>() >= core::mem::size_
|
|||||||
///
|
///
|
||||||
/// # Implementing Bus Devices
|
/// # Implementing Bus Devices
|
||||||
///
|
///
|
||||||
/// This section provides a guideline to implement bus specific devices, such as [`pci::Device`] or
|
/// This section provides a guideline to implement bus specific devices, such as:
|
||||||
/// [`platform::Device`].
|
#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
|
||||||
|
/// * [`platform::Device`]
|
||||||
///
|
///
|
||||||
/// A bus specific device should be defined as follows.
|
/// A bus specific device should be defined as follows.
|
||||||
///
|
///
|
||||||
@@ -160,7 +160,6 @@ static_assert!(core::mem::size_of::<bindings::driver_type>() >= core::mem::size_
|
|||||||
///
|
///
|
||||||
/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
|
/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
|
||||||
/// [`impl_device_context_deref`]: kernel::impl_device_context_deref
|
/// [`impl_device_context_deref`]: kernel::impl_device_context_deref
|
||||||
/// [`pci::Device`]: kernel::pci::Device
|
|
||||||
/// [`platform::Device`]: kernel::platform::Device
|
/// [`platform::Device`]: kernel::platform::Device
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct Device<Ctx: DeviceContext = Normal>(Opaque<bindings::device>, PhantomData<Ctx>);
|
pub struct Device<Ctx: DeviceContext = Normal>(Opaque<bindings::device>, PhantomData<Ctx>);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ use core::mem::MaybeUninit;
|
|||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`];
|
/// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`];
|
||||||
/// i.e. it's safe to transmute to `RawDeviceId`.
|
/// i.e. it's safe to transmute to `RawType`.
|
||||||
///
|
///
|
||||||
/// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building
|
/// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building
|
||||||
/// the ID table.
|
/// the ID table.
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ pub type DmaAddress = bindings::dma_addr_t;
|
|||||||
/// Trait to be implemented by DMA capable bus devices.
|
/// Trait to be implemented by DMA capable bus devices.
|
||||||
///
|
///
|
||||||
/// The [`dma::Device`](Device) trait should be implemented by bus specific device representations,
|
/// The [`dma::Device`](Device) trait should be implemented by bus specific device representations,
|
||||||
/// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
|
/// where the underlying bus is DMA capable, such as:
|
||||||
/// [`platform::Device`](::kernel::platform::Device).
|
#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
|
||||||
|
/// * [`platform::Device`](::kernel::platform::Device)
|
||||||
pub trait Device: AsRef<device::Device<Core>> {
|
pub trait Device: AsRef<device::Device<Core>> {
|
||||||
/// Set up the device's DMA streaming addressing capabilities.
|
/// Set up the device's DMA streaming addressing capabilities.
|
||||||
///
|
///
|
||||||
@@ -532,8 +533,6 @@ impl<T: AsBytes + FromBytes> CoherentAllocation<T> {
|
|||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// * Callers must ensure that the device does not read/write to/from memory while the returned
|
|
||||||
/// slice is live.
|
|
||||||
/// * Callers must ensure that this call does not race with a read or write to the same region
|
/// * Callers must ensure that this call does not race with a read or write to the same region
|
||||||
/// that overlaps with this write.
|
/// that overlaps with this write.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -33,7 +33,14 @@
|
|||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! For specific examples see [`auxiliary::Driver`], [`pci::Driver`] and [`platform::Driver`].
|
//! For specific examples see:
|
||||||
|
//!
|
||||||
|
//! * [`platform::Driver`](kernel::platform::Driver)
|
||||||
|
#"
|
||||||
|
)]
|
||||||
|
#")]
|
||||||
//!
|
//!
|
||||||
//! The `probe()` callback should return a `impl PinInit<Self, Error>`, i.e. the driver's private
|
//! The `probe()` callback should return a `impl PinInit<Self, Error>`, i.e. the driver's private
|
||||||
//! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
|
//! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
|
||||||
@@ -79,7 +86,6 @@
|
|||||||
//!
|
//!
|
||||||
//! For this purpose the generic infrastructure in [`device_id`] should be used.
|
//! For this purpose the generic infrastructure in [`device_id`] should be used.
|
||||||
//!
|
//!
|
||||||
//! [`auxiliary::Driver`]: kernel::auxiliary::Driver
|
|
||||||
//! [`Core`]: device::Core
|
//! [`Core`]: device::Core
|
||||||
//! [`Device`]: device::Device
|
//! [`Device`]: device::Device
|
||||||
//! [`Device<Core>`]: device::Device<device::Core>
|
//! [`Device<Core>`]: device::Device<device::Core>
|
||||||
@@ -87,8 +93,6 @@
|
|||||||
//! [`DeviceContext`]: device::DeviceContext
|
//! [`DeviceContext`]: device::DeviceContext
|
||||||
//! [`device_id`]: kernel::device_id
|
//! [`device_id`]: kernel::device_id
|
||||||
//! [`module_driver`]: kernel::module_driver
|
//! [`module_driver`]: kernel::module_driver
|
||||||
//! [`pci::Driver`]: kernel::pci::Driver
|
|
||||||
//! [`platform::Driver`]: kernel::platform::Driver
|
|
||||||
|
|
||||||
use crate::error::{Error, Result};
|
use crate::error::{Error, Result};
|
||||||
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};
|
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ use core::ops::Deref;
|
|||||||
///
|
///
|
||||||
/// # Invariants
|
/// # Invariants
|
||||||
///
|
///
|
||||||
/// `Bar` always holds an `IoRaw` inststance that holds a valid pointer to the start of the I/O
|
/// `Bar` always holds an `IoRaw` instance that holds a valid pointer to the start of the I/O
|
||||||
/// memory mapped PCI BAR and its size.
|
/// memory mapped PCI BAR and its size.
|
||||||
pub struct Bar<const SIZE: usize = 0> {
|
pub struct Bar<const SIZE: usize = 0> {
|
||||||
pdev: ARef<Device>,
|
pdev: ARef<Device>,
|
||||||
@@ -54,7 +54,7 @@ impl<const SIZE: usize> Bar<SIZE> {
|
|||||||
let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize;
|
let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize;
|
||||||
if ioptr == 0 {
|
if ioptr == 0 {
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// `pdev` valid by the invariants of `Device`.
|
// `pdev` is valid by the invariants of `Device`.
|
||||||
// `num` is checked for validity by a previous call to `Device::resource_len`.
|
// `num` is checked for validity by a previous call to `Device::resource_len`.
|
||||||
unsafe { bindings::pci_release_region(pdev.as_raw(), num) };
|
unsafe { bindings::pci_release_region(pdev.as_raw(), num) };
|
||||||
return Err(ENOMEM);
|
return Err(ENOMEM);
|
||||||
|
|||||||
Reference in New Issue
Block a user