summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-10-10 08:11:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-11 16:46:25 +0200
commitb6c514bd1c2e13955ddd6a26df2c33ae74f17d0b (patch)
treec15bcedb9f2f15e41abc69f4bad3a06a92ae7add /arch/arm/mach-omap
parent15111afb387482035fc64ca5b621ec6c933ac7f8 (diff)
downloadbarebox-b6c514bd1c2e13955ddd6a26df2c33ae74f17d0b.tar.gz
barebox-b6c514bd1c2e13955ddd6a26df2c33ae74f17d0b.tar.xz
treewide: replace errno_str() with %m printf format specifier
Both errno_str() and printf("%m" end up calling strerror(). %m is more convenient to use, so switch over all instances to it. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r--arch/arm/mach-omap/am33xx_bbu_emmc.c15
-rw-r--r--arch/arm/mach-omap/am33xx_bbu_spi_mlo.c6
2 files changed, 10 insertions, 11 deletions
diff --git a/arch/arm/mach-omap/am33xx_bbu_emmc.c b/arch/arm/mach-omap/am33xx_bbu_emmc.c
index 29e13de778..c3d4f9c422 100644
--- a/arch/arm/mach-omap/am33xx_bbu_emmc.c
+++ b/arch/arm/mach-omap/am33xx_bbu_emmc.c
@@ -42,16 +42,15 @@ static int emmc_mlo_handler(struct bbu_handler *handler, struct bbu_data *data)
fd = open(handler->devicefile, O_RDWR);
if (fd < 0) {
- pr_err("could not open %s: %s\n", handler->devicefile,
- errno_str());
+ pr_err("could not open %s: %m\n", handler->devicefile);
return fd;
}
/* save the partition table */
ret = pread(fd, part_table, PART_TABLE_SIZE, PART_TABLE_OFFSET);
if (ret < 0) {
- pr_err("could not read partition table from fd %s: %s\n",
- handler->devicefile, errno_str());
+ pr_err("could not read partition table from fd %s: %m\n",
+ handler->devicefile);
goto error;
}
@@ -59,8 +58,8 @@ static int emmc_mlo_handler(struct bbu_handler *handler, struct bbu_data *data)
for (i = 0; i < 4; i++) {
ret = pwrite(fd, image, size, i * 0x20000);
if (ret < 0) {
- pr_err("could not write MLO %i/4 to fd %s: %s\n",
- i + 1, handler->devicefile, errno_str());
+ pr_err("could not write MLO %i/4 to fd %s: %m\n",
+ i + 1, handler->devicefile);
goto error_save_part_table;
}
}
@@ -69,8 +68,8 @@ error_save_part_table:
/* write the partition table back */
ret = pwrite(fd, part_table, PART_TABLE_SIZE, PART_TABLE_OFFSET);
if (ret < 0)
- pr_err("could not write partition table to fd %s: %s\n",
- handler->devicefile, errno_str());
+ pr_err("could not write partition table to fd %s: %m\n",
+ handler->devicefile);
error:
close(fd);
diff --git a/arch/arm/mach-omap/am33xx_bbu_spi_mlo.c b/arch/arm/mach-omap/am33xx_bbu_spi_mlo.c
index 7d2ef1f0f2..f36c2c3bf0 100644
--- a/arch/arm/mach-omap/am33xx_bbu_spi_mlo.c
+++ b/arch/arm/mach-omap/am33xx_bbu_spi_mlo.c
@@ -51,7 +51,7 @@ static int spi_nor_mlo_handler(struct bbu_handler *handler,
ret = stat(data->devicefile, &s);
if (ret) {
- printf("could not open %s: %s", data->devicefile, errno_str());
+ printf("could not open %s: %m", data->devicefile);
return ret;
}
@@ -66,14 +66,14 @@ static int spi_nor_mlo_handler(struct bbu_handler *handler,
dstfd = open(data->devicefile, O_WRONLY);
if (dstfd < 0) {
- printf("could not open %s: %s", data->devicefile, errno_str());
+ printf("could not open %s: %m", data->devicefile);
ret = dstfd;
goto out;
}
ret = erase(dstfd, ERASE_SIZE_ALL, 0);
if (ret < 0) {
- printf("could not erase %s: %s", data->devicefile, errno_str());
+ printf("could not erase %s: %m", data->devicefile);
goto out1;
}