Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <saravanak@google.com>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Saravana Kannan and committed by
Rob Herring
7d34ca38 418370ff

+2 -1
+1 -1
drivers/base/core.c
··· 121 121 * Check if @target depends on @dev or any device dependent on it (its child or 122 122 * its consumer etc). Return 1 if that is the case or 0 otherwise. 123 123 */ 124 - static int device_is_dependent(struct device *dev, void *target) 124 + int device_is_dependent(struct device *dev, void *target) 125 125 { 126 126 struct device_link *link; 127 127 int ret;
+1
include/linux/device.h
··· 829 829 extern const char *device_get_devnode(struct device *dev, 830 830 umode_t *mode, kuid_t *uid, kgid_t *gid, 831 831 const char **tmp); 832 + extern int device_is_dependent(struct device *dev, void *target); 832 833 833 834 static inline bool device_supports_offline(struct device *dev) 834 835 {