From: Saravana Kannan Date: Wed, 10 Jun 2020 01:19:33 +0000 (-0700) Subject: driver core: Add device_is_dependent() to linux/device.h X-Git-Tag: v5.10.7~1949^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d34ca3854845398cb36866d14bbdc43dcec1ad0;p=platform%2Fkernel%2Flinux-rpi.git driver core: Add device_is_dependent() to linux/device.h DT implementation of fw_devlink needs this function to detect cycles. So make it available. Signed-off-by: Saravana Kannan Tested-by: John Stultz Signed-off-by: Rob Herring --- diff --git a/drivers/base/core.c b/drivers/base/core.c index 67d39a9..320a0e1 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -121,7 +121,7 @@ int device_links_read_lock_held(void) * Check if @target depends on @dev or any device dependent on it (its child or * its consumer etc). Return 1 if that is the case or 0 otherwise. */ -static int device_is_dependent(struct device *dev, void *target) +int device_is_dependent(struct device *dev, void *target) { struct device_link *link; int ret; diff --git a/include/linux/device.h b/include/linux/device.h index 15460a5..33cece5 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -829,6 +829,7 @@ extern int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid); extern const char *device_get_devnode(struct device *dev, umode_t *mode, kuid_t *uid, kgid_t *gid, const char **tmp); +extern int device_is_dependent(struct device *dev, void *target); static inline bool device_supports_offline(struct device *dev) {