Commit fe151462 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'driver-core-5.10-rc1' of...

Merge tag 'driver-core-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the "big" set of driver core patches for 5.10-rc1

  They include a lot of different things, all related to the driver core
  and/or some driver logic:

   - sysfs common write functions to make it easier to audit sysfs
     attributes

   - device connection cleanups and fixes

   - devm helpers for a few functions

   - NOIO allocations for when devices are being removed

   - minor cleanups and fixes

  All have been in linux-next for a while with no reported issues"

* tag 'driver-core-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (31 commits)
  regmap: debugfs: use semicolons rather than commas to separate statements
  platform/x86: intel_pmc_core: do not create a static struct device
  drivers core: node: Use a more typical macro definition style for ACCESS_ATTR
  drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show
  mm: and drivers core: Convert hugetlb_report_node_meminfo to sysfs_emit
  drivers core: Miscellaneous changes for sysfs_emit
  drivers core: Reindent a couple uses around sysfs_emit
  drivers core: Remove strcat uses around sysfs_emit and neaten
  drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
  sysfs: Add sysfs_emit and sysfs_emit_at to format sysfs output
  dyndbg: use keyword, arg varnames for query term pairs
  driver core: force NOIO allocations during unplug
  platform_device: switch to simpler IDA interface
  driver core: platform: Document return type of more functions
  Revert "driver core: Annotate dev_err_probe() with __must_check"
  Revert "test_firmware: Test platform fw loading on non-EFI systems"
  iio: adc: xilinx-xadc: use devm_krealloc()
  hwmon: pmbus: use more devres helpers
  devres: provide devm_krealloc()
  syscore: Use pm_pr_dbg() for syscore_{suspend,resume}()
  ...
parents 5d6c413c ee490677
Loading
Loading
Loading
Loading
+0 −43
Original line number Diff line number Diff line
==================
Device connections
==================

Introduction
------------

Devices often have connections to other devices that are outside of the direct
child/parent relationship. A serial or network communication controller, which
could be a PCI device, may need to be able to get a reference to its PHY
component, which could be attached for example to the I2C bus. Some device
drivers need to be able to control the clocks or the GPIOs for their devices,
and so on.

Device connections are generic descriptions of any type of connection between
two separate devices.

Device connections alone do not create a dependency between the two devices.
They are only descriptions which are not tied to either of the devices directly.
A dependency between the two devices exists only if one of the two endpoint
devices requests a reference to the other. The descriptions themselves can be
defined in firmware (not yet supported) or they can be built-in.

Usage
-----

Device connections should exist before device ``->probe`` callback is called for
either endpoint device in the description. If the connections are defined in
firmware, this is not a problem. It should be considered if the connection
descriptions are "built-in", and need to be added separately.

The connection description consists of the names of the two devices with the
connection, i.e. the endpoints, and unique identifier for the connection which
is needed if there are multiple connections between the two devices.

After a description exists, the devices in it can request reference to the other
endpoint device, or they can request the description itself.

API
---

.. kernel-doc:: drivers/base/devcon.c
   :functions: device_connection_find_match device_connection_find device_connection_add device_connection_remove
+1 −0
Original line number Diff line number Diff line
@@ -354,6 +354,7 @@ MEM
  devm_kmalloc()
  devm_kmalloc_array()
  devm_kmemdup()
  devm_krealloc()
  devm_kstrdup()
  devm_kvasprintf()
  devm_kzalloc()
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ fallback mechanism:
  supported for request_firmware_into_buf().

* Firmware is not accessible through typical means:

        * It cannot be installed into the root filesystem
        * The firmware provides very unique device specific data tailored for
          the unit gathered with local information. An example is calibration
+0 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ available subsections can be seen below.
   pm/index
   clk
   device-io
   device_connection
   dma-buf
   device_link
   component
+3 −5
Original line number Diff line number Diff line
@@ -241,12 +241,10 @@ Other notes:
  is 4096.

- show() methods should return the number of bytes printed into the
  buffer. This is the return value of scnprintf().
  buffer.

- show() must not use snprintf() when formatting the value to be
  returned to user space. If you can guarantee that an overflow
  will never happen you can use sprintf() otherwise you must use
  scnprintf().
- show() should only use sysfs_emit() or sysfs_emit_at() when formatting
  the value to be returned to user space.

- store() should return the number of bytes used from the buffer. If the
  entire buffer has been used, just return the count argument.
Loading