Commit 7d34ca38 authored by Saravana Kannan's avatar Saravana Kannan Committed by Rob Herring

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: default avatarSaravana Kannan <saravanak@google.com>
Tested-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 418370ff
...@@ -121,7 +121,7 @@ int device_links_read_lock_held(void) ...@@ -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 * 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. * 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; struct device_link *link;
int ret; int ret;
......
...@@ -829,6 +829,7 @@ extern int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid); ...@@ -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, extern const char *device_get_devnode(struct device *dev,
umode_t *mode, kuid_t *uid, kgid_t *gid, umode_t *mode, kuid_t *uid, kgid_t *gid,
const char **tmp); const char **tmp);
extern int device_is_dependent(struct device *dev, void *target);
static inline bool device_supports_offline(struct device *dev) static inline bool device_supports_offline(struct device *dev)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment