Skip to content

Commit 0fe6f78

Browse files
YongWu-HFgregkh
authored andcommitted
driver core: Remove the link if there is no driver with AUTO flag
DL_FLAG_AUTOREMOVE_CONSUMER/SUPPLIER means "Remove the link automatically on consumer/supplier driver unbind", that means we should remove whole the device_link when there is no this driver no matter what the ref_count of the link is. CC: Greg Kroah-Hartman <[email protected]> Signed-off-by: Yong Wu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8a4b326 commit 0fe6f78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/base/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static void __device_links_no_driver(struct device *dev)
512512
continue;
513513

514514
if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER)
515-
kref_put(&link->kref, __device_link_del);
515+
__device_link_del(&link->kref);
516516
else if (link->status != DL_STATE_SUPPLIER_UNBIND)
517517
WRITE_ONCE(link->status, DL_STATE_AVAILABLE);
518518
}
@@ -557,7 +557,7 @@ void device_links_driver_cleanup(struct device *dev)
557557
*/
558558
if (link->status == DL_STATE_SUPPLIER_UNBIND &&
559559
link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER)
560-
kref_put(&link->kref, __device_link_del);
560+
__device_link_del(&link->kref);
561561

562562
WRITE_ONCE(link->status, DL_STATE_DORMANT);
563563
}

0 commit comments

Comments
 (0)