diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c index 577ccc0..32e2173 100644 --- a/arch/arm/boards/highbank/init.c +++ b/arch/arm/boards/highbank/init.c @@ -37,14 +37,12 @@ if (!(reg & HB_PWRDOM_STAT_SATA)) { for_each_compatible_node_from(node, root, NULL, "calxeda,hb-ahci") - of_set_property(node, "status", "disabled", - sizeof("disabled"), 1); + of_property_write_string(node, "status", "disabled"); } if (!(reg & HB_PWRDOM_STAT_EMMC)) { for_each_compatible_node_from(node, root, NULL, "calxeda,hb-sdhci") - of_set_property(node, "status", "disabled", - sizeof("disabled"), 1); + of_property_write_string(node, "status", "disabled"); } if ((opp_table[0] >> 16) != HB_OPP_VERSION) diff --git a/arch/arm/cpu/psci.c b/arch/arm/cpu/psci.c index d650c23..eafb361 100644 --- a/arch/arm/cpu/psci.c +++ b/arch/arm/cpu/psci.c @@ -204,13 +204,11 @@ if (!psci) return -EINVAL; - ret = of_set_property(psci, "compatible", "arm,psci-1.0", - strlen("arm,psci-1.0") + 1, 1); + ret = of_property_write_string(psci, "compatible", "arm,psci-1.0"); if (ret) return ret; - ret = of_set_property(psci, "method", "smc", - strlen("smc") + 1, 1); + ret = of_property_write_string(psci, "method", "smc"); if (ret) return ret; diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c index c1a2643..e7d92ea 100644 --- a/arch/sandbox/board/hostfile.c +++ b/arch/sandbox/board/hostfile.c @@ -133,8 +133,7 @@ node = of_new_node(root, hf->devname); - ret = of_set_property(node, "compatible", hostfile_dt_ids->compatible, - strlen(hostfile_dt_ids->compatible) + 1, 1); + ret = of_property_write_string(node, "compatible", hostfile_dt_ids->compatible); if (ret) return ret; @@ -146,8 +145,7 @@ if (ret) return ret; - ret = of_set_property(node, "barebox,filename", hf->filename, - strlen(hf->filename) + 1, 1); + ret = of_property_write_string(node, "barebox,filename", hf->filename); return ret; } diff --git a/common/memory.c b/common/memory.c index ad38b00..ff5bdc1 100644 --- a/common/memory.c +++ b/common/memory.c @@ -185,7 +185,7 @@ if (!memnode) return -ENOMEM; - err = of_set_property(memnode, "device_type", "memory", sizeof("memory"), 1); + err = of_property_write_string(memnode, "device_type", "memory"); if (err) return err; diff --git a/common/oftree.c b/common/oftree.c index e98b908..09a4455 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -128,7 +128,7 @@ return -ENOMEM; - err = of_set_property(node, "bootargs", str, strlen(str) + 1, 1); + err = of_property_write_string(node, "bootargs", str); return err; } diff --git a/common/state/state.c b/common/state/state.c index 4020d5e..02bb1bb 100644 --- a/common/state/state.c +++ b/common/state/state.c @@ -167,9 +167,8 @@ if ((conv == STATE_CONVERT_TO_NODE) || (conv == STATE_CONVERT_FIXUP)) { - ret = of_set_property(new_node, "type", - vtype->type_name, - strlen(vtype->type_name) + 1, 1); + ret = of_property_write_string(new_node, "type", + vtype->type_name); if (ret) goto out; diff --git a/drivers/of/base.c b/drivers/of/base.c index 01ab389..6632f4d 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -2115,7 +2115,7 @@ */ int of_device_disable(struct device_node *node) { - return of_set_property(node, "status", "disabled", sizeof("disabled"), 1); + return of_property_write_string(node, "status", "disabled"); } /** diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c index 3572629..a2c59de 100644 --- a/drivers/video/simplefb.c +++ b/drivers/video/simplefb.c @@ -89,9 +89,6 @@ static int simplefb_create_node(struct device_node *root, const struct fb_info *fbi, const char *format) { - const char *compat = "simple-framebuffer"; - const char *disabled = "disabled"; - const char *okay = "okay"; struct device_node *node; u32 cells[2]; int ret; @@ -100,12 +97,11 @@ if (!node) return -ENOMEM; - ret = of_set_property(node, "status", disabled, - strlen(disabled) + 1, 1); + ret = of_property_write_string(node, "status", "disabled"); if (ret < 0) return ret; - ret = of_set_property(node, "compatible", compat, strlen(compat) + 1, 1); + ret = of_property_write_string(node, "compatible", "simple-framebuffer"); if (ret) return ret; @@ -130,14 +126,14 @@ if (ret < 0) return ret; - ret = of_set_property(node, "format", format, strlen(format) + 1, 1); + ret = of_property_write_string(node, "format", format); if (ret < 0) return ret; of_add_reserve_entry((u32)fbi->screen_base, (u32)fbi->screen_base + fbi->screen_size); - return of_set_property(node, "status", okay, strlen(okay) + 1, 1); + return of_property_write_string(node, "status", "okay"); } static int simplefb_of_fixup(struct device_node *root, void *ctx)