Skip to content

Commit 0fa2789

Browse files
committed
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
2 parents b061fcf + 8510ef5 commit 0fa2789

6 files changed

Lines changed: 19 additions & 17 deletions

File tree

Documentation/ABI/testing/sysfs-devices-soc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ Date: January 2012
1717
contact: Lee Jones <lee@kernel.org>
1818
Description:
1919
Read-only attribute common to all SoCs. Contains the SoC machine
20-
name (e.g. Ux500).
20+
name (e.g. DB8500).
2121

2222
What: /sys/devices/socX/family
2323
Date: January 2012
2424
contact: Lee Jones <lee@kernel.org>
2525
Description:
2626
Read-only attribute common to all SoCs. Contains SoC family name
27-
(e.g. DB8500).
27+
(e.g. ux500).
2828

2929
On many of ARM based silicon with SMCCC v1.2+ compliant firmware
3030
this will contain the JEDEC JEP106 manufacturer’s identification

rust/kernel/device.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use core::{any::TypeId, marker::PhantomData, ptr};
1414

1515
#[cfg(CONFIG_PRINTK)]
1616
use crate::c_str;
17-
use crate::str::CStrExt as _;
1817

1918
pub mod property;
2019

@@ -67,8 +66,9 @@ static_assert!(core::mem::size_of::<bindings::driver_type>() >= core::mem::size_
6766
///
6867
/// # Implementing Bus Devices
6968
///
70-
/// This section provides a guideline to implement bus specific devices, such as [`pci::Device`] or
71-
/// [`platform::Device`].
69+
/// This section provides a guideline to implement bus specific devices, such as:
70+
#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
71+
/// * [`platform::Device`]
7272
///
7373
/// A bus specific device should be defined as follows.
7474
///
@@ -160,7 +160,6 @@ static_assert!(core::mem::size_of::<bindings::driver_type>() >= core::mem::size_
160160
///
161161
/// [`AlwaysRefCounted`]: kernel::types::AlwaysRefCounted
162162
/// [`impl_device_context_deref`]: kernel::impl_device_context_deref
163-
/// [`pci::Device`]: kernel::pci::Device
164163
/// [`platform::Device`]: kernel::platform::Device
165164
#[repr(transparent)]
166165
pub struct Device<Ctx: DeviceContext = Normal>(Opaque<bindings::device>, PhantomData<Ctx>);

rust/kernel/device_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use core::mem::MaybeUninit;
1515
/// # Safety
1616
///
1717
/// Implementers must ensure that `Self` is layout-compatible with [`RawDeviceId::RawType`];
18-
/// i.e. it's safe to transmute to `RawDeviceId`.
18+
/// i.e. it's safe to transmute to `RawType`.
1919
///
2020
/// This requirement is needed so `IdArray::new` can convert `Self` to `RawType` when building
2121
/// the ID table.

rust/kernel/dma.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ pub type DmaAddress = bindings::dma_addr_t;
2727
/// Trait to be implemented by DMA capable bus devices.
2828
///
2929
/// The [`dma::Device`](Device) trait should be implemented by bus specific device representations,
30-
/// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
31-
/// [`platform::Device`](::kernel::platform::Device).
30+
/// where the underlying bus is DMA capable, such as:
31+
#[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")]
32+
/// * [`platform::Device`](::kernel::platform::Device)
3233
pub trait Device: AsRef<device::Device<Core>> {
3334
/// Set up the device's DMA streaming addressing capabilities.
3435
///
@@ -532,8 +533,6 @@ impl<T: AsBytes + FromBytes> CoherentAllocation<T> {
532533
///
533534
/// # Safety
534535
///
535-
/// * Callers must ensure that the device does not read/write to/from memory while the returned
536-
/// slice is live.
537536
/// * Callers must ensure that this call does not race with a read or write to the same region
538537
/// that overlaps with this write.
539538
///

rust/kernel/driver.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@
3333
//! }
3434
//! ```
3535
//!
36-
//! For specific examples see [`auxiliary::Driver`], [`pci::Driver`] and [`platform::Driver`].
36+
//! For specific examples see:
37+
//!
38+
//! * [`platform::Driver`](kernel::platform::Driver)
39+
#![cfg_attr(
40+
CONFIG_AUXILIARY_BUS,
41+
doc = "* [`auxiliary::Driver`](kernel::auxiliary::Driver)"
42+
)]
43+
#![cfg_attr(CONFIG_PCI, doc = "* [`pci::Driver`](kernel::pci::Driver)")]
3744
//!
3845
//! The `probe()` callback should return a `impl PinInit<Self, Error>`, i.e. the driver's private
3946
//! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
@@ -79,16 +86,13 @@
7986
//!
8087
//! For this purpose the generic infrastructure in [`device_id`] should be used.
8188
//!
82-
//! [`auxiliary::Driver`]: kernel::auxiliary::Driver
8389
//! [`Core`]: device::Core
8490
//! [`Device`]: device::Device
8591
//! [`Device<Core>`]: device::Device<device::Core>
8692
//! [`Device<CoreInternal>`]: device::Device<device::CoreInternal>
8793
//! [`DeviceContext`]: device::DeviceContext
8894
//! [`device_id`]: kernel::device_id
8995
//! [`module_driver`]: kernel::module_driver
90-
//! [`pci::Driver`]: kernel::pci::Driver
91-
//! [`platform::Driver`]: kernel::platform::Driver
9296
9397
use crate::error::{Error, Result};
9498
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};

rust/kernel/pci/io.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use core::ops::Deref;
2020
///
2121
/// # Invariants
2222
///
23-
/// `Bar` always holds an `IoRaw` inststance that holds a valid pointer to the start of the I/O
23+
/// `Bar` always holds an `IoRaw` instance that holds a valid pointer to the start of the I/O
2424
/// memory mapped PCI BAR and its size.
2525
pub struct Bar<const SIZE: usize = 0> {
2626
pdev: ARef<Device>,
@@ -54,7 +54,7 @@ impl<const SIZE: usize> Bar<SIZE> {
5454
let ioptr: usize = unsafe { bindings::pci_iomap(pdev.as_raw(), num, 0) } as usize;
5555
if ioptr == 0 {
5656
// SAFETY:
57-
// `pdev` valid by the invariants of `Device`.
57+
// `pdev` is valid by the invariants of `Device`.
5858
// `num` is checked for validity by a previous call to `Device::resource_len`.
5959
unsafe { bindings::pci_release_region(pdev.as_raw(), num) };
6060
return Err(ENOMEM);

0 commit comments

Comments
 (0)