lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] coresight: Defer probe when the child dev is not probed
Date
From: Mao Jinlong <jinlmao@qti.qualcomm.com>

It is possible that when device probe, its child device is not
probed. Then it will fail when add sysfs connection for the device.
Make device defer probe when the child device is not probed.

Signed-off-by: Mao Jinlong <jinlmao@qti.qualcomm.com>
---
drivers/hwtracing/coresight/coresight-sysfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-sysfs.c b/drivers/hwtracing/coresight/coresight-sysfs.c
index 34d2a2d31d00..7df9eb59bf2c 100644
--- a/drivers/hwtracing/coresight/coresight-sysfs.c
+++ b/drivers/hwtracing/coresight/coresight-sysfs.c
@@ -73,8 +73,10 @@ int coresight_add_sysfs_link(struct coresight_sysfs_link *info)
if (!info->orig || !info->target ||
!info->orig_name || !info->target_name)
return -EINVAL;
- if (!info->orig->has_conns_grp || !info->target->has_conns_grp)
+ if (!info->orig->has_conns_grp)
return -EINVAL;
+ if (!info->target->has_conns_grp)
+ return -EPROBE_DEFER;

/* first link orig->target */
ret = sysfs_add_link_to_group(&info->orig->dev.kobj,
--
2.17.1
\
 
 \ /
  Last update: 2022-02-28 14:32    [W:0.053 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site