u-boot/doc/usage/cmd/unbind.rst
Tom Rini 11da3403e9 doc: usage: Add general rule for $?
For nearly all commands in U-Boot the '?' variable is handled the same
way with 0 meaning success, 1 meaning any failure.  Explain this in the
general rules section of the cmdline documentation (with a link to a
counter example) and then remove the redundant wording from most
commands. We retain a section about the return value in a number of
places where we are doing something such as always returning a specific
value or we have useful additional information to go along with the
normal return codes.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-10-26 09:03:35 -06:00

94 lines
2.5 KiB
ReStructuredText

.. SPDX-License-Identifier: GPL-2.0+:
.. index::
single: unbind (command)
unbind command
==============
Synopsis
--------
::
unbind <node path>
unbind <class> <seq>
unbind <class> <seq> <driver>
Description
-----------
The unbind command is used to unbind a device from a driver. This makes the
device unavailable in U-Boot.
node path
path of the device's device-tree node
class
device class name
seq
sequence number of the device in the device class
driver
device driver name
Example
-------
Given a system with a real time clock device with device path */pl031@9010000*
and using driver rtc-pl031 unbinding and binding of the device is demonstrated
using the three alternative unbind syntaxes.
.. code-block::
=> dm tree
Class Seq Probed Driver Name
-----------------------------------------------------------
root 0 [ + ] root_driver root_driver
...
rtc 0 [ ] rtc-pl031 |-- pl031@9010000
...
=> fdt addr $fdtcontroladdr
Working FDT set to 7ed7fdb0
=> fdt print
/ {
interrupt-parent = <0x00008003>;
model = "linux,dummy-virt";
#size-cells = <0x00000002>;
#address-cells = <0x00000002>;
compatible = "linux,dummy-virt";
...
pl031@9010000 {
clock-names = "apb_pclk";
clocks = <0x00008000>;
interrupts = <0x00000000 0x00000002 0x00000004>;
reg = <0x00000000 0x09010000 0x00000000 0x00001000>;
compatible = "arm,pl031", "arm,primecell";
};
...
}
=> unbind /pl031@9010000
=> dm tree
Class Seq Probed Driver Name
-----------------------------------------------------------
root 0 [ + ] root_driver root_driver
...
=> unbind /pl031@9010000
Cannot find a device with path /pl031@9010000
=> bind /pl031@9010000 rtc-pl031
=> dm tree
Class Seq Probed Driver Name
-----------------------------------------------------------
root 0 [ + ] root_driver root_driver
...
rtc 0 [ ] rtc-pl031 |-- pl031@9010000
=> unbind rtc 0
=> bind /pl031@9010000 rtc-pl031
=> unbind rtc 0 rtc-pl031
Configuration
-------------
The unbind command is only available if CONFIG_CMD_BIND=y.