diff mbox

[U-Boot,v3,34/54] dm: power: Avoid case-insensitve match for child names

Message ID 1435095556-15924-35-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass June 23, 2015, 9:38 p.m. UTC
This is not user input (i.e. from the command line). It should be possible
to get the case correct and avoid the case-insensitive match. This will
help avoid sloppy device tree setups.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/power/pmic/pmic-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Przemyslaw Marczak July 1, 2015, 9:44 a.m. UTC | #1
Hello,

On 06/23/2015 11:38 PM, Simon Glass wrote:
> This is not user input (i.e. from the command line). It should be possible
> to get the case correct and avoid the case-insensitive match. This will
> help avoid sloppy device tree setups.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>   drivers/power/pmic/pmic-uclass.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
> index 812ac13..40b5135 100644
> --- a/drivers/power/pmic/pmic-uclass.c
> +++ b/drivers/power/pmic/pmic-uclass.c
> @@ -55,7 +55,7 @@ int pmic_bind_children(struct udevice *pmic, int offset,
>   		child = NULL;
>   		for (info = child_info; info->prefix && info->driver; info++) {
>   			prefix_len = strlen(info->prefix);
> -			if (strncasecmp(info->prefix, node_name, prefix_len))
> +			if (strncmp(info->prefix, node_name, prefix_len))
>   				continue;
>
>   			debug("  - compatible prefix: '%s'\n", info->prefix);
>

Tested on:
- Odroid U3 (odroid_defconfig)
- Sandbox - ut pmic/regulator

Tested-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

Best regards,
Simon Glass July 17, 2015, 11:57 p.m. UTC | #2
On 1 July 2015 at 03:44, Przemyslaw Marczak <p.marczak@samsung.com> wrote:
> Hello,
>
> On 06/23/2015 11:38 PM, Simon Glass wrote:
>>
>> This is not user input (i.e. from the command line). It should be possible
>> to get the case correct and avoid the case-insensitive match. This will
>> help avoid sloppy device tree setups.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>> Changes in v3: None
>> Changes in v2: None
>>
>>   drivers/power/pmic/pmic-uclass.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/power/pmic/pmic-uclass.c
>> b/drivers/power/pmic/pmic-uclass.c
>> index 812ac13..40b5135 100644
>> --- a/drivers/power/pmic/pmic-uclass.c
>> +++ b/drivers/power/pmic/pmic-uclass.c
>> @@ -55,7 +55,7 @@ int pmic_bind_children(struct udevice *pmic, int offset,
>>                 child = NULL;
>>                 for (info = child_info; info->prefix && info->driver;
>> info++) {
>>                         prefix_len = strlen(info->prefix);
>> -                       if (strncasecmp(info->prefix, node_name,
>> prefix_len))
>> +                       if (strncmp(info->prefix, node_name, prefix_len))
>>                                 continue;
>>
>>                         debug("  - compatible prefix: '%s'\n",
>> info->prefix);
>>
>
> Tested on:
> - Odroid U3 (odroid_defconfig)
> - Sandbox - ut pmic/regulator
>
> Tested-by: Przemyslaw Marczak <p.marczak@samsung.com>
> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

Thanks for all the testing and review!

Applied to u-boot-dm.
diff mbox

Patch

diff --git a/drivers/power/pmic/pmic-uclass.c b/drivers/power/pmic/pmic-uclass.c
index 812ac13..40b5135 100644
--- a/drivers/power/pmic/pmic-uclass.c
+++ b/drivers/power/pmic/pmic-uclass.c
@@ -55,7 +55,7 @@  int pmic_bind_children(struct udevice *pmic, int offset,
 		child = NULL;
 		for (info = child_info; info->prefix && info->driver; info++) {
 			prefix_len = strlen(info->prefix);
-			if (strncasecmp(info->prefix, node_name, prefix_len))
+			if (strncmp(info->prefix, node_name, prefix_len))
 				continue;
 
 			debug("  - compatible prefix: '%s'\n", info->prefix);