drivers: core: use strcmp when find device by name
PATCH 1/1 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.
--- drivers/core/uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/core/uclass.c +1 -1
@@ -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 ; }
Signature · 1 line
2.16.4
PATCH 1/1 drivers: core: use strcmp when find device by name
Quoted 9 lines · Peng Fan
if (!strncmp(dev->name, name, strlen(name)))might find out the wrong device, it might find outdram_pll_ref_sel, when name isdram_pll. So use strcmp to avoid such issue.Signed-off-by Peng Fan <[email protected]>--- drivers/core/uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This seems to match the function description in the header file, too.
PATCH 1/1 drivers: core: use strcmp when find device by name
Hi Simon,
Quoted 8 lines
Subject: Re: [PATCH] drivers: core: use strcmp when find device by name
Quoted 5 lines · Peng Fan
if (!strncmp(dev->name, name, strlen(name)))might find out the wrong device, it might find outdram_pll_ref_sel, when name isdram_pll. So use strcmp to avoid such issue.
Quoted 8 lines
Quoted 4 lines
Signed-off-by Peng Fan <[email protected]>--- drivers/core/uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Simon Glass <[email protected]>This seems to match the function description in the header file, too.
Will you pick up this patch? Not see this patch in your tree.
Thanks,
Peng.
PATCH 1/1 drivers: core: use strcmp when find device by name
Hi Peng,
Quoted 16 lines · Peng Fan
Hi Simon,
Quoted 13 lines
Subject: Re: [PATCH] drivers: core: use strcmp when find device by name
Quoted 9 lines · Peng Fan
if (!strncmp(dev->name, name, strlen(name)))might find out the wrong device, it might find outdram_pll_ref_sel, when name isdram_pll. So use strcmp to avoid such issue.Signed-off-by Peng Fan <[email protected]>--- drivers/core/uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines
Quoted 3 lines
Reviewed-by Simon Glass <[email protected]>This seems to match the function description in the header file, too.
Will you pick up this patch? Not see this patch in your tree.
I found that this causes a test failure - can you try 'make qcheck' and see if you can figure out what is going on?
Regards,
Simon
PATCH 1/1 drivers: core: use strcmp when find device by name
Hi Simon,
Quoted 22 lines
Subject: Re: [PATCH] drivers: core: use strcmp when find device by name
Hi Peng,
Quoted 17 lines · Peng Fan
Hi Simon,
Quoted 14 lines
Subject: Re: [PATCH] drivers: core: use strcmp when find device by name
Quoted 9 lines · Peng Fan
if (!strncmp(dev->name, name, strlen(name)))might find out the wrong device, it might find outdram_pll_ref_sel, when name isdram_pll. So use strcmp to avoid such issue.Signed-off-by Peng Fan <[email protected]>--- drivers/core/uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Reviewed-by Simon Glass <[email protected]>This seems to match the function description in the header file, too.
Will you pick up this patch? Not see this patch in your tree.
I found that this causes a test failure - can you try 'make qcheck' and see if you can figure out what is going on?
With this patch applied. Test/dm/adc.c and usb.c needs some change to use real device name. I just posted out new patchset including this one.
Pease review.
Thanks,
Peng
Quoted 3 lines
Regards,
Simon