diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-11 16:52:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-15 12:21:45 +0200 |
commit | 947fb5adf8af450507c978abf1c7ec9f051e5842 (patch) | |
tree | af790669292308b56baf188611ac430012037cba /drivers/of | |
parent | 48b205e32342fc8a2648b2bd3f1f6d9a7d74e6cb (diff) | |
download | barebox-947fb5adf8af450507c978abf1c7ec9f051e5842.tar.gz barebox-947fb5adf8af450507c978abf1c7ec9f051e5842.tar.xz |
string: Fix (v)asprintf prototypes
Our asprintf and vasprintf have different prototypes than the glibc
functions. This causes trouble when we want to share barebox code
with userspace code. Change the prototypes for (v)asprintf to match
the glibc prototypes. Since the current (v)asprintf are convenient
to use change the existing functions to b(v)asprintf.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/barebox.c | 2 | ||||
-rw-r--r-- | drivers/of/base.c | 3 | ||||
-rw-r--r-- | drivers/of/of_path.c | 2 | ||||
-rw-r--r-- | drivers/of/partition.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/drivers/of/barebox.c b/drivers/of/barebox.c index 125feef2cc..64f483326d 100644 --- a/drivers/of/barebox.c +++ b/drivers/of/barebox.c @@ -61,7 +61,7 @@ static int environment_check_mount(struct device_d *dev, char **devpath) /* Set env to be in a file on the now mounted device */ dev_dbg(dev, "Loading default env from %s on device %s\n", filepath, *devpath); - *devpath = asprintf("%s/%s", ENV_MNT_DIR, filepath); + *devpath = basprintf("%s/%s", ENV_MNT_DIR, filepath); return 0; } diff --git a/drivers/of/base.c b/drivers/of/base.c index d12bfe328a..b4ef8e362f 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1702,7 +1702,8 @@ struct device_node *of_new_node(struct device_node *parent, const char *name) if (parent) { node->name = xstrdup(name); - node->full_name = asprintf("%s/%s", node->parent->full_name, name); + node->full_name = basprintf("%s/%s", + node->parent->full_name, name); list_add(&node->list, &parent->list); } else { node->name = xstrdup(""); diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c index ed620f1755..8e1931f939 100644 --- a/drivers/of/of_path.c +++ b/drivers/of/of_path.c @@ -75,7 +75,7 @@ static int __of_find_path(struct device_node *node, const char *part, char **out mtd_can_have_bb(cdev->mtd)) add_bb = true; - *outpath = asprintf("/dev/%s%s", cdev->name, add_bb ? ".bb" : ""); + *outpath = basprintf("/dev/%s%s", cdev->name, add_bb ? ".bb" : ""); return 0; } diff --git a/drivers/of/partition.c b/drivers/of/partition.c index 6017897b02..b6621f7dad 100644 --- a/drivers/of/partition.c +++ b/drivers/of/partition.c @@ -58,7 +58,7 @@ struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node) if (of_get_property(node, "read-only", &len)) flags = DEVFS_PARTITION_READONLY; - filename = asprintf("%s.%s", cdev->name, partname); + filename = basprintf("%s.%s", cdev->name, partname); new = devfs_add_partition(cdev->name, offset, size, flags, filename); if (IS_ERR(new)) |