When using modules we want to unregister the xref as on a following load the device will not exist anymore.
The situation is the following :
- One module have different drivers in it with dependencies between them.
- Due to EARLY_DRIVER pass not being honored for modules (as we are already at the last pass) the order of probing will be the node order in the DTB.
- During the first load driver1 which depend on driver2 will not get the xref and defers its attach. The next pass will get the xref and finish the attach.
- After an unload the xref stays
- During the second load, driver1 will get the old device_t reference for driver2 and we will fail if we try to call any methods from it.