aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/of/base.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 0b2e4dc40a1f..df9626747afb 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -715,13 +715,8 @@ static struct device_node *__of_find_node_by_path(struct device_node *parent,
{
struct device_node *child;
int len;
- const char *end;
- end = strchr(path, ':');
- if (!end)
- end = strchrnul(path, '/');
-
- len = end - path;
+ len = strcspn(path, "/:");
if (!len)
return NULL;