fdt: Add a do_fixup_by_path_string() function
PATCH v2 1/2 fdt: Add a do_fixup_by_path_string() function
The do_fixup_by_path_string() will set the specified node's property to the value contained in "status". It would just be a wrapper for do_fixup_by_path() that calls strlen on the argument.
--- common/fdt_support.c | 8 +++++++- include/fdt_support.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletions(-)
common/fdt_support.c +7 -1
@@ -2,7 +2,7 @@* (C) Copyright 2007 * Gerald Van Baren, Custom IDEAS, vanbaren at cideas.com * -* Copyright 2010 Freescale Semiconductor, Inc. +* Copyright 2010-2011 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project.
@@ -307,6 +307,12 @@ void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,do_fixup_by_path (fdt, path, prop, &val,sizeof (val), create); } +void do_fixup_by_path_string (void *fdt,const char *path,const char *prop, +const char *status) +{ +do_fixup_by_path (fdt, path, prop, status,strlen (status) +1 ,1 ); +} + void do_fixup_by_prop(void *fdt, const char *pname, const void *pval, int plen, const char *prop, const void *val, int len,
include/fdt_support.h +2 -0
@@ -36,6 +36,8 @@ void do_fixup_by_path(void *fdt, const char *path, const char *prop, const void *val, int len, int create);void do_fixup_by_path_u32 (void *fdt,const char *path,const char *prop,u32 val,int create); +void do_fixup_by_path_string (void *fdt,const char *path,const char *prop, +const char *status); void do_fixup_by_prop(void *fdt, const char *pname, const void *pval, int plen, const char *prop, const void *val, int len,
Signature · 1 line
1.5.6.5
PATCH v2 1/2 fdt: Add a do_fixup_by_path_string() function
Quoted 25 lines · Chunhe Lan
The
do_fixup_by_path_string()will set the specified node's property to the value contained in "status". It would just be a wrapper fordo_fixup_by_path()that calls strlen on the argument.Signed-off-by Chunhe Lan <[email protected]>--- common/fdt_support.c | 8 +++++++- include/fdt_support.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletions(-)common/fdt_support.c +1
-1@@ -2,7 +2,7 @@* (C) Copyright 2007 * Gerald Van Baren, Custom IDEAS, vanbaren at cideas.com * -* Copyright 2010 Freescale Semiconductor, Inc. +* Copyright 2010-2011 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project.
common/fdt_support.c void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop, · line 315
Quoted 9 lines
common/fdt_support.c +6
-0@@ -307,6 +307,12 @@ void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,do_fixup_by_path (fdt, path, prop, &val,sizeof (val), create); } +void do_fixup_by_path_string (void *fdt,const char *path,const char *prop, +const char *status) +{ +do_fixup_by_path (fdt, path, prop, status,strlen (status) +1 ,1 ); +} +
Put this in a header file as an inline function, so that strlen() can evaluate to a constant if the string is constant.
-Scott
PATCH v2 1/2 fdt: Add a do_fixup_by_path_string() function
Quoted 30 lines · Scott Wood
Quoted 29 lines · Chunhe Lan
The
do_fixup_by_path_string()will set the specified node's property to the value contained in "status". It would just be a wrapper fordo_fixup_by_path()that calls strlen on the argument.Signed-off-by Chunhe Lan <[email protected]>--- common/fdt_support.c | 8 +++++++- include/fdt_support.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletions(-)common/fdt_support.c +1
-1@@ -2,7 +2,7 @@* (C) Copyright 2007 * Gerald Van Baren, Custom IDEAS, vanbaren at cideas.com * -* Copyright 2010 Freescale Semiconductor, Inc. +* Copyright 2010-2011 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -307,6 +307,12 @@ void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,do_fixup_by_path (fdt, path, prop, &val,sizeof (val), create); }
Quoted 10 lines
common/fdt_support.c void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop, · line 315
Quoted 7 lines
common/fdt_support.c +6
-0+void do_fixup_by_path_string (void *fdt,const char *path,const char *prop, +const char *status) +{ +do_fixup_by_path (fdt, path, prop, status,strlen (status) +1 ,1 ); +} +Put this in a header file as an inline function, so that
strlen()can evaluate to a constant if the string is constant.
OK.
Thanks.
-Jack Lan