driver core: Remove the link if there is no driver with AUTO flag
authorYong Wu <yong.wu@mediatek.com>
Tue, 1 Jan 2019 04:51:05 +0000 (12:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 10:55:57 +0000 (11:55 +0100)
commitb600c5a14eb9676bd62e034d3c699f0405fe8ad9
tree56816947ce5a48689feb1cd5a35cf88f75e56eb6
parent6bdf6513f33087fb2280c8c40439f362e7ee6fdc
driver core: Remove the link if there is no driver with AUTO flag

commit 0fe6f7874d467456da6f6a221dd92499a3ab1780 upstream.

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 <gregkh@linuxfoundation.org>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c