summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-09-18 15:22:58 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-19 09:55:42 +0200
commitb2d990a9e80faf8632d73a0450c05bbf8a79f718 (patch)
treed85566d6f6f2bd637d336f2aff62876cb5d9717a /arch
parent37b5422784fffe2633e141b08222ac4bf5504929 (diff)
downloadbarebox-b2d990a9e80faf8632d73a0450c05bbf8a79f718.tar.gz
barebox-b2d990a9e80faf8632d73a0450c05bbf8a79f718.tar.xz
ARM: i.MX: bbu: Convert devicefile to device name
Data->devicefile can contain absolute path to target device, so we need to convert it to a device name before we can safely use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/imx-bbu-internal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index faa2665720..14bc569b72 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -409,8 +409,9 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
char *bootpartvar;
const char *bootpart;
char *devicefile;
+ const char *devname = devpath_to_name(data->devicefile);
- ret = asprintf(&bootpartvar, "%s.boot", data->devicefile);
+ ret = asprintf(&bootpartvar, "%s.boot", devname);
if (ret < 0)
return ret;
@@ -427,7 +428,7 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
bootpart = "boot0";
}
- ret = asprintf(&devicefile, "/dev/%s.%s", data->devicefile, bootpart);
+ ret = asprintf(&devicefile, "/dev/%s.%s", devname, bootpart);
if (ret < 0)
goto free_bootpartvar;