提交 4213609c 编写于 作者: P Peng Fan 提交者: Tom Rini

drivers: core: use strcmp when find device by name

`if (!strncmp(dev->name, name, strlen(name)))` might find out
the wrong device, it might find out `dram_pll_ref_sel`, when name is
`dram_pll`. So use strcmp to avoid such issue.
Signed-off-by: NPeng Fan <peng.fan@nxp.com>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
上级 819ac50d
......@@ -260,7 +260,7 @@ int uclass_find_device_by_name(enum uclass_id id, const char *name,
return ret;
uclass_foreach_dev(dev, uc) {
if (!strncmp(dev->name, name, strlen(name))) {
if (!strcmp(dev->name, name)) {
*devp = dev;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册