* [PATCH] driver-core: improve driver binding documentation
@ 2026-01-15 21:56 Danilo Krummrich
2026-01-16 11:18 ` Greg KH
2026-01-16 18:15 ` Jonathan Corbet
0 siblings, 2 replies; 3+ messages in thread
From: Danilo Krummrich @ 2026-01-15 21:56 UTC (permalink / raw)
To: gregkh, rafael, corbet; +Cc: linux-doc, linux-kernel, Danilo Krummrich
The driver binding documentation (still) mentions that "When a driver is
attached to a device, the device is inserted into the driver's list of
devices.".
While it is true that the driver-core keeps track of all the devices
that are attached to a driver, this is purely for internal purposes
(i.e. it is an implementation detail) and has no relevance for user
facing documentation.
In fact, it is even misleading, since it could be read as if it were
valid for driver implementations to keep track of all the devices bound
to it.
Instead, drivers operate on a per-device basis, with a separate
per-device instance created when the driver is bound to a device.
Hence, remove the mention of a driver's list of devices and instead add
some documentation of the relationship between drivers and devices.
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
Documentation/driver-api/driver-model/binding.rst | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/driver-api/driver-model/binding.rst b/Documentation/driver-api/driver-model/binding.rst
index 7ea1d7a41e1d..d1d311a4011f 100644
--- a/Documentation/driver-api/driver-model/binding.rst
+++ b/Documentation/driver-api/driver-model/binding.rst
@@ -53,9 +53,12 @@ class's register_dev callback.
Driver
~~~~~~
-When a driver is attached to a device, the device is inserted into the
-driver's list of devices.
-
+When a driver is attached to a device, the driver's probe() function is
+called. Within probe(), the driver initializes the device and allocates
+and initializes per-device data structures. This per-device state is
+associated with the device object for as long as the driver remains bound
+to it. Conceptually, this per-device data together with the binding to
+the device can be thought of as an instance of the driver.
sysfs
~~~~~
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] driver-core: improve driver binding documentation
2026-01-15 21:56 [PATCH] driver-core: improve driver binding documentation Danilo Krummrich
@ 2026-01-16 11:18 ` Greg KH
2026-01-16 18:15 ` Jonathan Corbet
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-01-16 11:18 UTC (permalink / raw)
To: Danilo Krummrich; +Cc: rafael, corbet, linux-doc, linux-kernel
On Thu, Jan 15, 2026 at 10:56:57PM +0100, Danilo Krummrich wrote:
> The driver binding documentation (still) mentions that "When a driver is
> attached to a device, the device is inserted into the driver's list of
> devices.".
>
> While it is true that the driver-core keeps track of all the devices
> that are attached to a driver, this is purely for internal purposes
> (i.e. it is an implementation detail) and has no relevance for user
> facing documentation.
>
> In fact, it is even misleading, since it could be read as if it were
> valid for driver implementations to keep track of all the devices bound
> to it.
>
> Instead, drivers operate on a per-device basis, with a separate
> per-device instance created when the driver is bound to a device.
>
> Hence, remove the mention of a driver's list of devices and instead add
> some documentation of the relationship between drivers and devices.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> Documentation/driver-api/driver-model/binding.rst | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/driver-api/driver-model/binding.rst b/Documentation/driver-api/driver-model/binding.rst
> index 7ea1d7a41e1d..d1d311a4011f 100644
> --- a/Documentation/driver-api/driver-model/binding.rst
> +++ b/Documentation/driver-api/driver-model/binding.rst
> @@ -53,9 +53,12 @@ class's register_dev callback.
> Driver
> ~~~~~~
>
> -When a driver is attached to a device, the device is inserted into the
> -driver's list of devices.
> -
> +When a driver is attached to a device, the driver's probe() function is
> +called. Within probe(), the driver initializes the device and allocates
> +and initializes per-device data structures. This per-device state is
> +associated with the device object for as long as the driver remains bound
> +to it. Conceptually, this per-device data together with the binding to
> +the device can be thought of as an instance of the driver.
>
> sysfs
> ~~~~~
> --
> 2.52.0
>
Wow that was written a long time ago, thanks for updating it.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] driver-core: improve driver binding documentation
2026-01-15 21:56 [PATCH] driver-core: improve driver binding documentation Danilo Krummrich
2026-01-16 11:18 ` Greg KH
@ 2026-01-16 18:15 ` Jonathan Corbet
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Corbet @ 2026-01-16 18:15 UTC (permalink / raw)
To: Danilo Krummrich, gregkh, rafael
Cc: linux-doc, linux-kernel, Danilo Krummrich
Danilo Krummrich <dakr@kernel.org> writes:
> The driver binding documentation (still) mentions that "When a driver is
> attached to a device, the device is inserted into the driver's list of
> devices.".
>
> While it is true that the driver-core keeps track of all the devices
> that are attached to a driver, this is purely for internal purposes
> (i.e. it is an implementation detail) and has no relevance for user
> facing documentation.
>
> In fact, it is even misleading, since it could be read as if it were
> valid for driver implementations to keep track of all the devices bound
> to it.
>
> Instead, drivers operate on a per-device basis, with a separate
> per-device instance created when the driver is bound to a device.
>
> Hence, remove the mention of a driver's list of devices and instead add
> some documentation of the relationship between drivers and devices.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> Documentation/driver-api/driver-model/binding.rst | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/driver-api/driver-model/binding.rst b/Documentation/driver-api/driver-model/binding.rst
> index 7ea1d7a41e1d..d1d311a4011f 100644
> --- a/Documentation/driver-api/driver-model/binding.rst
> +++ b/Documentation/driver-api/driver-model/binding.rst
> @@ -53,9 +53,12 @@ class's register_dev callback.
> Driver
> ~~~~~~
>
> -When a driver is attached to a device, the device is inserted into the
> -driver's list of devices.
> -
> +When a driver is attached to a device, the driver's probe() function is
> +called. Within probe(), the driver initializes the device and allocates
> +and initializes per-device data structures. This per-device state is
> +associated with the device object for as long as the driver remains bound
> +to it. Conceptually, this per-device data together with the binding to
> +the device can be thought of as an instance of the driver.
Applied, thanks.
jon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-16 18:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-15 21:56 [PATCH] driver-core: improve driver binding documentation Danilo Krummrich
2026-01-16 11:18 ` Greg KH
2026-01-16 18:15 ` Jonathan Corbet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox