driver core: Call sync_state() even if supplier has no consumers
authorSaravana Kannan <saravanak@google.com>
Fri, 21 Feb 2020 08:05:08 +0000 (00:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Mar 2020 12:46:03 +0000 (13:46 +0100)
commit21eb93f432b1a785df193df1a56a59e9eb3a985f
treeb5eb0566c382adca2d60d20ef5973370eab73b78
parentae91c92565494a37c30ce9a691c87890f800d826
driver core: Call sync_state() even if supplier has no consumers

The initial patch that added sync_state() support didn't handle the case
where a supplier has no consumers. This was because when a device is
successfully bound with a driver, only its suppliers were checked to see
if they are eligible to get a sync_state(). This is not sufficient for
devices that have no consumers but still need to do device state clean
up. So fix this.

Fixes: fc5a251d0fd7ca90 (driver core: Add sync_state driver/bus callback)
Signed-off-by: Saravana Kannan <saravanak@google.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200221080510.197337-2-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c