summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-09-18 15:22:59 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-19 09:55:42 +0200
commit6f7dadffaf7e9e8f8313e337677dc127ed3f81d3 (patch)
treee87c78d1c4355c7e6a57663f6b23aae6ee185647 /arch
parentb2d990a9e80faf8632d73a0450c05bbf8a79f718 (diff)
downloadbarebox-6f7dadffaf7e9e8f8313e337677dc127ed3f81d3.tar.gz
barebox-6f7dadffaf7e9e8f8313e337677dc127ed3f81d3.tar.xz
ARM: i.MX: bbu: Detect MMC before reading current boot partition
In order to be able to read "mmcN.boot" we need to detect that device first. Not doing so would result in failure if "barebox_update" is executed before "detect mmc0". 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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index 14bc569b72..796d9454c3 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -411,6 +411,12 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler,
char *devicefile;
const char *devname = devpath_to_name(data->devicefile);
+ ret = device_detect_by_name(devname);
+ if (ret) {
+ pr_err("Couldn't detect device '%s'\n", devname);
+ return ret;
+ }
+
ret = asprintf(&bootpartvar, "%s.boot", devname);
if (ret < 0)
return ret;