summaryrefslogtreecommitdiffstats
path: root/lib/cmdlinepart.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cmdlinepart.c')
-rw-r--r--lib/cmdlinepart.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index 5b9f33ca1b..f1bfda641c 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -3,9 +3,6 @@
*
* Copyright (c) 2015 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
@@ -32,8 +29,7 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
loff_t size;
char *end;
char buf[PATH_MAX] = {};
- unsigned long flags = 0;
- int ret = 0;
+ unsigned long flags = DEVFS_PARTITION_FOR_FIXUP;
struct cdev *cdev;
memset(buf, 0, PATH_MAX);
@@ -88,11 +84,11 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
cdev = devfs_add_partition(devname, *offset, size, flags, buf);
if (IS_ERR(cdev)) {
- ret = PTR_ERR(cdev);
- printf("cannot create %s: %s\n", buf, strerror(-ret));
+ printf("cannot create %s: %pe\n", buf, cdev);
+ return PTR_ERR(cdev);
}
- return ret;
+ return 0;
}
int cmdlinepart_do_parse(const char *devname, const char *parts, loff_t devsize,