mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
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: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
819ac50d2a
commit
4213609cc7
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue