1.. SPDX-License-Identifier: GPL-2.0+:
2
3unbind command
4==============
5
6Synopsis
7--------
8
9::
10
11    unbind <node path>
12    unbind <class> <index>
13    unbind <class> <index> <driver>
14
15Description
16-----------
17
18The unbind command is used to unbind a device from a driver. This makes the
19device unavailable in U-Boot.
20
21node path
22    path of the device's device-tree node
23
24class
25    device class name
26
27index
28    index of the device in the device class
29
30driver
31    device driver name
32
33Example
34-------
35
36Given a system with a real time clock device with device path */pl031@9010000*
37and using driver rtc-pl031 unbinding and binding of the device is demonstrated
38using the three alternative unbind syntaxes.
39
40.. code-block::
41
42    => dm tree
43     Class     Index  Probed  Driver                Name
44    -----------------------------------------------------------
45     root          0  [ + ]   root_driver           root_driver
46    ...
47     rtc           0  [   ]   rtc-pl031             |-- pl031@9010000
48    ...
49    => fdt addr $fdtcontroladdr
50    Working FDT set to 7ed7fdb0
51    => fdt print
52    / {
53            interrupt-parent = <0x00008003>;
54            model = "linux,dummy-virt";
55            #size-cells = <0x00000002>;
56            #address-cells = <0x00000002>;
57            compatible = "linux,dummy-virt";
58    ...
59            pl031@9010000 {
60                    clock-names = "apb_pclk";
61                    clocks = <0x00008000>;
62                    interrupts = <0x00000000 0x00000002 0x00000004>;
63                    reg = <0x00000000 0x09010000 0x00000000 0x00001000>;
64                    compatible = "arm,pl031", "arm,primecell";
65            };
66    ...
67    }
68    => unbind /pl031@9010000
69    => dm tree
70     Class     Index  Probed  Driver                Name
71    -----------------------------------------------------------
72     root          0  [ + ]   root_driver           root_driver
73    ...
74    => unbind /pl031@9010000
75    Cannot find a device with path /pl031@9010000
76    => bind /pl031@9010000 rtc-pl031
77    => dm tree
78     Class     Index  Probed  Driver                Name
79    -----------------------------------------------------------
80     root          0  [ + ]   root_driver           root_driver
81    ...
82     rtc           0  [   ]   rtc-pl031             |-- pl031@9010000
83    => unbind rtc 0
84    => bind /pl031@9010000 rtc-pl031
85    => unbind rtc 0 rtc-pl031
86
87Configuration
88-------------
89
90The unbind command is only available if CONFIG_CMD_BIND=y.
91
92Return code
93-----------
94
95The return code $? is 0 (true) on success and 1 (false) on failure.
96