1*4882a593Smuzhiyun.. _device_link: 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun============ 4*4882a593SmuzhiyunDevice links 5*4882a593Smuzhiyun============ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunBy default, the driver core only enforces dependencies between devices 8*4882a593Smuzhiyunthat are borne out of a parent/child relationship within the device 9*4882a593Smuzhiyunhierarchy: When suspending, resuming or shutting down the system, devices 10*4882a593Smuzhiyunare ordered based on this relationship, i.e. children are always suspended 11*4882a593Smuzhiyunbefore their parent, and the parent is always resumed before its children. 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunSometimes there is a need to represent device dependencies beyond the 14*4882a593Smuzhiyunmere parent/child relationship, e.g. between siblings, and have the 15*4882a593Smuzhiyundriver core automatically take care of them. 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunSecondly, the driver core by default does not enforce any driver presence 18*4882a593Smuzhiyundependencies, i.e. that one device must be bound to a driver before 19*4882a593Smuzhiyunanother one can probe or function correctly. 20*4882a593Smuzhiyun 21*4882a593SmuzhiyunOften these two dependency types come together, so a device depends on 22*4882a593Smuzhiyunanother one both with regards to driver presence *and* with regards to 23*4882a593Smuzhiyunsuspend/resume and shutdown ordering. 24*4882a593Smuzhiyun 25*4882a593SmuzhiyunDevice links allow representation of such dependencies in the driver core. 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunIn its standard or *managed* form, a device link combines *both* dependency 28*4882a593Smuzhiyuntypes: It guarantees correct suspend/resume and shutdown ordering between a 29*4882a593Smuzhiyun"supplier" device and its "consumer" devices, and it guarantees driver 30*4882a593Smuzhiyunpresence on the supplier. The consumer devices are not probed before the 31*4882a593Smuzhiyunsupplier is bound to a driver, and they're unbound before the supplier 32*4882a593Smuzhiyunis unbound. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunWhen driver presence on the supplier is irrelevant and only correct 35*4882a593Smuzhiyunsuspend/resume and shutdown ordering is needed, the device link may 36*4882a593Smuzhiyunsimply be set up with the ``DL_FLAG_STATELESS`` flag. In other words, 37*4882a593Smuzhiyunenforcing driver presence on the supplier is optional. 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunAnother optional feature is runtime PM integration: By setting the 40*4882a593Smuzhiyun``DL_FLAG_PM_RUNTIME`` flag on addition of the device link, the PM core 41*4882a593Smuzhiyunis instructed to runtime resume the supplier and keep it active 42*4882a593Smuzhiyunwhenever and for as long as the consumer is runtime resumed. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunUsage 45*4882a593Smuzhiyun===== 46*4882a593Smuzhiyun 47*4882a593SmuzhiyunThe earliest point in time when device links can be added is after 48*4882a593Smuzhiyun:c:func:`device_add()` has been called for the supplier and 49*4882a593Smuzhiyun:c:func:`device_initialize()` has been called for the consumer. 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunIt is legal to add them later, but care must be taken that the system 52*4882a593Smuzhiyunremains in a consistent state: E.g. a device link cannot be added in 53*4882a593Smuzhiyunthe midst of a suspend/resume transition, so either commencement of 54*4882a593Smuzhiyunsuch a transition needs to be prevented with :c:func:`lock_system_sleep()`, 55*4882a593Smuzhiyunor the device link needs to be added from a function which is guaranteed 56*4882a593Smuzhiyunnot to run in parallel to a suspend/resume transition, such as from a 57*4882a593Smuzhiyundevice ``->probe`` callback or a boot-time PCI quirk. 58*4882a593Smuzhiyun 59*4882a593SmuzhiyunAnother example for an inconsistent state would be a device link that 60*4882a593Smuzhiyunrepresents a driver presence dependency, yet is added from the consumer's 61*4882a593Smuzhiyun``->probe`` callback while the supplier hasn't started to probe yet: Had the 62*4882a593Smuzhiyundriver core known about the device link earlier, it wouldn't have probed the 63*4882a593Smuzhiyunconsumer in the first place. The onus is thus on the consumer to check 64*4882a593Smuzhiyunpresence of the supplier after adding the link, and defer probing on 65*4882a593Smuzhiyunnon-presence. [Note that it is valid to create a link from the consumer's 66*4882a593Smuzhiyun``->probe`` callback while the supplier is still probing, but the consumer must 67*4882a593Smuzhiyunknow that the supplier is functional already at the link creation time (that is 68*4882a593Smuzhiyunthe case, for instance, if the consumer has just acquired some resources that 69*4882a593Smuzhiyunwould not have been available had the supplier not been functional then).] 70*4882a593Smuzhiyun 71*4882a593SmuzhiyunIf a device link with ``DL_FLAG_STATELESS`` set (i.e. a stateless device link) 72*4882a593Smuzhiyunis added in the ``->probe`` callback of the supplier or consumer driver, it is 73*4882a593Smuzhiyuntypically deleted in its ``->remove`` callback for symmetry. That way, if the 74*4882a593Smuzhiyundriver is compiled as a module, the device link is added on module load and 75*4882a593Smuzhiyunorderly deleted on unload. The same restrictions that apply to device link 76*4882a593Smuzhiyunaddition (e.g. exclusion of a parallel suspend/resume transition) apply equally 77*4882a593Smuzhiyunto deletion. Device links managed by the driver core are deleted automatically 78*4882a593Smuzhiyunby it. 79*4882a593Smuzhiyun 80*4882a593SmuzhiyunSeveral flags may be specified on device link addition, two of which 81*4882a593Smuzhiyunhave already been mentioned above: ``DL_FLAG_STATELESS`` to express that no 82*4882a593Smuzhiyundriver presence dependency is needed (but only correct suspend/resume and 83*4882a593Smuzhiyunshutdown ordering) and ``DL_FLAG_PM_RUNTIME`` to express that runtime PM 84*4882a593Smuzhiyunintegration is desired. 85*4882a593Smuzhiyun 86*4882a593SmuzhiyunTwo other flags are specifically targeted at use cases where the device 87*4882a593Smuzhiyunlink is added from the consumer's ``->probe`` callback: ``DL_FLAG_RPM_ACTIVE`` 88*4882a593Smuzhiyuncan be specified to runtime resume the supplier and prevent it from suspending 89*4882a593Smuzhiyunbefore the consumer is runtime suspended. ``DL_FLAG_AUTOREMOVE_CONSUMER`` 90*4882a593Smuzhiyuncauses the device link to be automatically purged when the consumer fails to 91*4882a593Smuzhiyunprobe or later unbinds. 92*4882a593Smuzhiyun 93*4882a593SmuzhiyunSimilarly, when the device link is added from supplier's ``->probe`` callback, 94*4882a593Smuzhiyun``DL_FLAG_AUTOREMOVE_SUPPLIER`` causes the device link to be automatically 95*4882a593Smuzhiyunpurged when the supplier fails to probe or later unbinds. 96*4882a593Smuzhiyun 97*4882a593SmuzhiyunIf neither ``DL_FLAG_AUTOREMOVE_CONSUMER`` nor ``DL_FLAG_AUTOREMOVE_SUPPLIER`` 98*4882a593Smuzhiyunis set, ``DL_FLAG_AUTOPROBE_CONSUMER`` can be used to request the driver core 99*4882a593Smuzhiyunto probe for a driver for the consumer driver on the link automatically after 100*4882a593Smuzhiyuna driver has been bound to the supplier device. 101*4882a593Smuzhiyun 102*4882a593SmuzhiyunNote, however, that any combinations of ``DL_FLAG_AUTOREMOVE_CONSUMER``, 103*4882a593Smuzhiyun``DL_FLAG_AUTOREMOVE_SUPPLIER`` or ``DL_FLAG_AUTOPROBE_CONSUMER`` with 104*4882a593Smuzhiyun``DL_FLAG_STATELESS`` are invalid and cannot be used. 105*4882a593Smuzhiyun 106*4882a593SmuzhiyunLimitations 107*4882a593Smuzhiyun=========== 108*4882a593Smuzhiyun 109*4882a593SmuzhiyunDriver authors should be aware that a driver presence dependency for managed 110*4882a593Smuzhiyundevice links (i.e. when ``DL_FLAG_STATELESS`` is not specified on link addition) 111*4882a593Smuzhiyunmay cause probing of the consumer to be deferred indefinitely. This can become 112*4882a593Smuzhiyuna problem if the consumer is required to probe before a certain initcall level 113*4882a593Smuzhiyunis reached. Worse, if the supplier driver is blacklisted or missing, the 114*4882a593Smuzhiyunconsumer will never be probed. 115*4882a593Smuzhiyun 116*4882a593SmuzhiyunMoreover, managed device links cannot be deleted directly. They are deleted 117*4882a593Smuzhiyunby the driver core when they are not necessary any more in accordance with the 118*4882a593Smuzhiyun``DL_FLAG_AUTOREMOVE_CONSUMER`` and ``DL_FLAG_AUTOREMOVE_SUPPLIER`` flags. 119*4882a593SmuzhiyunHowever, stateless device links (i.e. device links with ``DL_FLAG_STATELESS`` 120*4882a593Smuzhiyunset) are expected to be removed by whoever called :c:func:`device_link_add()` 121*4882a593Smuzhiyunto add them with the help of either :c:func:`device_link_del()` or 122*4882a593Smuzhiyun:c:func:`device_link_remove()`. 123*4882a593Smuzhiyun 124*4882a593SmuzhiyunPassing ``DL_FLAG_RPM_ACTIVE`` along with ``DL_FLAG_STATELESS`` to 125*4882a593Smuzhiyun:c:func:`device_link_add()` may cause the PM-runtime usage counter of the 126*4882a593Smuzhiyunsupplier device to remain nonzero after a subsequent invocation of either 127*4882a593Smuzhiyun:c:func:`device_link_del()` or :c:func:`device_link_remove()` to remove the 128*4882a593Smuzhiyundevice link returned by it. This happens if :c:func:`device_link_add()` is 129*4882a593Smuzhiyuncalled twice in a row for the same consumer-supplier pair without removing the 130*4882a593Smuzhiyunlink between these calls, in which case allowing the PM-runtime usage counter 131*4882a593Smuzhiyunof the supplier to drop on an attempt to remove the link may cause it to be 132*4882a593Smuzhiyunsuspended while the consumer is still PM-runtime-active and that has to be 133*4882a593Smuzhiyunavoided. [To work around this limitation it is sufficient to let the consumer 134*4882a593Smuzhiyunruntime suspend at least once, or call :c:func:`pm_runtime_set_suspended()` for 135*4882a593Smuzhiyunit with PM-runtime disabled, between the :c:func:`device_link_add()` and 136*4882a593Smuzhiyun:c:func:`device_link_del()` or :c:func:`device_link_remove()` calls.] 137*4882a593Smuzhiyun 138*4882a593SmuzhiyunSometimes drivers depend on optional resources. They are able to operate 139*4882a593Smuzhiyunin a degraded mode (reduced feature set or performance) when those resources 140*4882a593Smuzhiyunare not present. An example is an SPI controller that can use a DMA engine 141*4882a593Smuzhiyunor work in PIO mode. The controller can determine presence of the optional 142*4882a593Smuzhiyunresources at probe time but on non-presence there is no way to know whether 143*4882a593Smuzhiyunthey will become available in the near future (due to a supplier driver 144*4882a593Smuzhiyunprobing) or never. Consequently it cannot be determined whether to defer 145*4882a593Smuzhiyunprobing or not. It would be possible to notify drivers when optional 146*4882a593Smuzhiyunresources become available after probing, but it would come at a high cost 147*4882a593Smuzhiyunfor drivers as switching between modes of operation at runtime based on the 148*4882a593Smuzhiyunavailability of such resources would be much more complex than a mechanism 149*4882a593Smuzhiyunbased on probe deferral. In any case optional resources are beyond the 150*4882a593Smuzhiyunscope of device links. 151*4882a593Smuzhiyun 152*4882a593SmuzhiyunExamples 153*4882a593Smuzhiyun======== 154*4882a593Smuzhiyun 155*4882a593Smuzhiyun* An MMU device exists alongside a busmaster device, both are in the same 156*4882a593Smuzhiyun power domain. The MMU implements DMA address translation for the busmaster 157*4882a593Smuzhiyun device and shall be runtime resumed and kept active whenever and as long 158*4882a593Smuzhiyun as the busmaster device is active. The busmaster device's driver shall 159*4882a593Smuzhiyun not bind before the MMU is bound. To achieve this, a device link with 160*4882a593Smuzhiyun runtime PM integration is added from the busmaster device (consumer) 161*4882a593Smuzhiyun to the MMU device (supplier). The effect with regards to runtime PM 162*4882a593Smuzhiyun is the same as if the MMU was the parent of the master device. 163*4882a593Smuzhiyun 164*4882a593Smuzhiyun The fact that both devices share the same power domain would normally 165*4882a593Smuzhiyun suggest usage of a struct dev_pm_domain or struct generic_pm_domain, 166*4882a593Smuzhiyun however these are not independent devices that happen to share a power 167*4882a593Smuzhiyun switch, but rather the MMU device serves the busmaster device and is 168*4882a593Smuzhiyun useless without it. A device link creates a synthetic hierarchical 169*4882a593Smuzhiyun relationship between the devices and is thus more apt. 170*4882a593Smuzhiyun 171*4882a593Smuzhiyun* A Thunderbolt host controller comprises a number of PCIe hotplug ports 172*4882a593Smuzhiyun and an NHI device to manage the PCIe switch. On resume from system sleep, 173*4882a593Smuzhiyun the NHI device needs to re-establish PCI tunnels to attached devices 174*4882a593Smuzhiyun before the hotplug ports can resume. If the hotplug ports were children 175*4882a593Smuzhiyun of the NHI, this resume order would automatically be enforced by the 176*4882a593Smuzhiyun PM core, but unfortunately they're aunts. The solution is to add 177*4882a593Smuzhiyun device links from the hotplug ports (consumers) to the NHI device 178*4882a593Smuzhiyun (supplier). A driver presence dependency is not necessary for this 179*4882a593Smuzhiyun use case. 180*4882a593Smuzhiyun 181*4882a593Smuzhiyun* Discrete GPUs in hybrid graphics laptops often feature an HDA controller 182*4882a593Smuzhiyun for HDMI/DP audio. In the device hierarchy the HDA controller is a sibling 183*4882a593Smuzhiyun of the VGA device, yet both share the same power domain and the HDA 184*4882a593Smuzhiyun controller is only ever needed when an HDMI/DP display is attached to the 185*4882a593Smuzhiyun VGA device. A device link from the HDA controller (consumer) to the 186*4882a593Smuzhiyun VGA device (supplier) aptly represents this relationship. 187*4882a593Smuzhiyun 188*4882a593Smuzhiyun* ACPI allows definition of a device start order by way of _DEP objects. 189*4882a593Smuzhiyun A classical example is when ACPI power management methods on one device 190*4882a593Smuzhiyun are implemented in terms of I\ :sup:`2`\ C accesses and require a specific 191*4882a593Smuzhiyun I\ :sup:`2`\ C controller to be present and functional for the power 192*4882a593Smuzhiyun management of the device in question to work. 193*4882a593Smuzhiyun 194*4882a593Smuzhiyun* In some SoCs a functional dependency exists from display, video codec and 195*4882a593Smuzhiyun video processing IP cores on transparent memory access IP cores that handle 196*4882a593Smuzhiyun burst access and compression/decompression. 197*4882a593Smuzhiyun 198*4882a593SmuzhiyunAlternatives 199*4882a593Smuzhiyun============ 200*4882a593Smuzhiyun 201*4882a593Smuzhiyun* A struct dev_pm_domain can be used to override the bus, 202*4882a593Smuzhiyun class or device type callbacks. It is intended for devices sharing 203*4882a593Smuzhiyun a single on/off switch, however it does not guarantee a specific 204*4882a593Smuzhiyun suspend/resume ordering, this needs to be implemented separately. 205*4882a593Smuzhiyun It also does not by itself track the runtime PM status of the involved 206*4882a593Smuzhiyun devices and turn off the power switch only when all of them are runtime 207*4882a593Smuzhiyun suspended. Furthermore it cannot be used to enforce a specific shutdown 208*4882a593Smuzhiyun ordering or a driver presence dependency. 209*4882a593Smuzhiyun 210*4882a593Smuzhiyun* A struct generic_pm_domain is a lot more heavyweight than a 211*4882a593Smuzhiyun device link and does not allow for shutdown ordering or driver presence 212*4882a593Smuzhiyun dependencies. It also cannot be used on ACPI systems. 213*4882a593Smuzhiyun 214*4882a593SmuzhiyunImplementation 215*4882a593Smuzhiyun============== 216*4882a593Smuzhiyun 217*4882a593SmuzhiyunThe device hierarchy, which -- as the name implies -- is a tree, 218*4882a593Smuzhiyunbecomes a directed acyclic graph once device links are added. 219*4882a593Smuzhiyun 220*4882a593SmuzhiyunOrdering of these devices during suspend/resume is determined by the 221*4882a593Smuzhiyundpm_list. During shutdown it is determined by the devices_kset. With 222*4882a593Smuzhiyunno device links present, the two lists are a flattened, one-dimensional 223*4882a593Smuzhiyunrepresentations of the device tree such that a device is placed behind 224*4882a593Smuzhiyunall its ancestors. That is achieved by traversing the ACPI namespace 225*4882a593Smuzhiyunor OpenFirmware device tree top-down and appending devices to the lists 226*4882a593Smuzhiyunas they are discovered. 227*4882a593Smuzhiyun 228*4882a593SmuzhiyunOnce device links are added, the lists need to satisfy the additional 229*4882a593Smuzhiyunconstraint that a device is placed behind all its suppliers, recursively. 230*4882a593SmuzhiyunTo ensure this, upon addition of the device link the consumer and the 231*4882a593Smuzhiyunentire sub-graph below it (all children and consumers of the consumer) 232*4882a593Smuzhiyunare moved to the end of the list. (Call to :c:func:`device_reorder_to_tail()` 233*4882a593Smuzhiyunfrom :c:func:`device_link_add()`.) 234*4882a593Smuzhiyun 235*4882a593SmuzhiyunTo prevent introduction of dependency loops into the graph, it is 236*4882a593Smuzhiyunverified upon device link addition that the supplier is not dependent 237*4882a593Smuzhiyunon the consumer or any children or consumers of the consumer. 238*4882a593Smuzhiyun(Call to :c:func:`device_is_dependent()` from :c:func:`device_link_add()`.) 239*4882a593SmuzhiyunIf that constraint is violated, :c:func:`device_link_add()` will return 240*4882a593Smuzhiyun``NULL`` and a ``WARNING`` will be logged. 241*4882a593Smuzhiyun 242*4882a593SmuzhiyunNotably this also prevents the addition of a device link from a parent 243*4882a593Smuzhiyundevice to a child. However the converse is allowed, i.e. a device link 244*4882a593Smuzhiyunfrom a child to a parent. Since the driver core already guarantees 245*4882a593Smuzhiyuncorrect suspend/resume and shutdown ordering between parent and child, 246*4882a593Smuzhiyunsuch a device link only makes sense if a driver presence dependency is 247*4882a593Smuzhiyunneeded on top of that. In this case driver authors should weigh 248*4882a593Smuzhiyuncarefully if a device link is at all the right tool for the purpose. 249*4882a593SmuzhiyunA more suitable approach might be to simply use deferred probing or 250*4882a593Smuzhiyunadd a device flag causing the parent driver to be probed before the 251*4882a593Smuzhiyunchild one. 252*4882a593Smuzhiyun 253*4882a593SmuzhiyunState machine 254*4882a593Smuzhiyun============= 255*4882a593Smuzhiyun 256*4882a593Smuzhiyun.. kernel-doc:: include/linux/device.h 257*4882a593Smuzhiyun :functions: device_link_state 258*4882a593Smuzhiyun 259*4882a593Smuzhiyun:: 260*4882a593Smuzhiyun 261*4882a593Smuzhiyun .=============================. 262*4882a593Smuzhiyun | | 263*4882a593Smuzhiyun v | 264*4882a593Smuzhiyun DORMANT <=> AVAILABLE <=> CONSUMER_PROBE => ACTIVE 265*4882a593Smuzhiyun ^ | 266*4882a593Smuzhiyun | | 267*4882a593Smuzhiyun '============ SUPPLIER_UNBIND <============' 268*4882a593Smuzhiyun 269*4882a593Smuzhiyun* The initial state of a device link is automatically determined by 270*4882a593Smuzhiyun :c:func:`device_link_add()` based on the driver presence on the supplier 271*4882a593Smuzhiyun and consumer. If the link is created before any devices are probed, it 272*4882a593Smuzhiyun is set to ``DL_STATE_DORMANT``. 273*4882a593Smuzhiyun 274*4882a593Smuzhiyun* When a supplier device is bound to a driver, links to its consumers 275*4882a593Smuzhiyun progress to ``DL_STATE_AVAILABLE``. 276*4882a593Smuzhiyun (Call to :c:func:`device_links_driver_bound()` from 277*4882a593Smuzhiyun :c:func:`driver_bound()`.) 278*4882a593Smuzhiyun 279*4882a593Smuzhiyun* Before a consumer device is probed, presence of supplier drivers is 280*4882a593Smuzhiyun verified by checking the consumer device is not in the wait_for_suppliers 281*4882a593Smuzhiyun list and by checking that links to suppliers are in ``DL_STATE_AVAILABLE`` 282*4882a593Smuzhiyun state. The state of the links is updated to ``DL_STATE_CONSUMER_PROBE``. 283*4882a593Smuzhiyun (Call to :c:func:`device_links_check_suppliers()` from 284*4882a593Smuzhiyun :c:func:`really_probe()`.) 285*4882a593Smuzhiyun This prevents the supplier from unbinding. 286*4882a593Smuzhiyun (Call to :c:func:`wait_for_device_probe()` from 287*4882a593Smuzhiyun :c:func:`device_links_unbind_consumers()`.) 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun* If the probe fails, links to suppliers revert back to ``DL_STATE_AVAILABLE``. 290*4882a593Smuzhiyun (Call to :c:func:`device_links_no_driver()` from :c:func:`really_probe()`.) 291*4882a593Smuzhiyun 292*4882a593Smuzhiyun* If the probe succeeds, links to suppliers progress to ``DL_STATE_ACTIVE``. 293*4882a593Smuzhiyun (Call to :c:func:`device_links_driver_bound()` from :c:func:`driver_bound()`.) 294*4882a593Smuzhiyun 295*4882a593Smuzhiyun* When the consumer's driver is later on removed, links to suppliers revert 296*4882a593Smuzhiyun back to ``DL_STATE_AVAILABLE``. 297*4882a593Smuzhiyun (Call to :c:func:`__device_links_no_driver()` from 298*4882a593Smuzhiyun :c:func:`device_links_driver_cleanup()`, which in turn is called from 299*4882a593Smuzhiyun :c:func:`__device_release_driver()`.) 300*4882a593Smuzhiyun 301*4882a593Smuzhiyun* Before a supplier's driver is removed, links to consumers that are not 302*4882a593Smuzhiyun bound to a driver are updated to ``DL_STATE_SUPPLIER_UNBIND``. 303*4882a593Smuzhiyun (Call to :c:func:`device_links_busy()` from 304*4882a593Smuzhiyun :c:func:`__device_release_driver()`.) 305*4882a593Smuzhiyun This prevents the consumers from binding. 306*4882a593Smuzhiyun (Call to :c:func:`device_links_check_suppliers()` from 307*4882a593Smuzhiyun :c:func:`really_probe()`.) 308*4882a593Smuzhiyun Consumers that are bound are freed from their driver; consumers that are 309*4882a593Smuzhiyun probing are waited for until they are done. 310*4882a593Smuzhiyun (Call to :c:func:`device_links_unbind_consumers()` from 311*4882a593Smuzhiyun :c:func:`__device_release_driver()`.) 312*4882a593Smuzhiyun Once all links to consumers are in ``DL_STATE_SUPPLIER_UNBIND`` state, 313*4882a593Smuzhiyun the supplier driver is released and the links revert to ``DL_STATE_DORMANT``. 314*4882a593Smuzhiyun (Call to :c:func:`device_links_driver_cleanup()` from 315*4882a593Smuzhiyun :c:func:`__device_release_driver()`.) 316*4882a593Smuzhiyun 317*4882a593SmuzhiyunAPI 318*4882a593Smuzhiyun=== 319*4882a593Smuzhiyun 320*4882a593SmuzhiyunSee device_link_add(), device_link_del() and device_link_remove(). 321