summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-24 12:54:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-15 11:15:47 +0200
commit121c3d6e9c2fb4649f3349edc522c99f3b9585d9 (patch)
tree61deccc69452fe6338c231118df5c1f8a4440aa5 /arch/x86
parent98df44ee7d6db3919a4dd11e227d1e0caedbfe86 (diff)
downloadbarebox-121c3d6e9c2fb4649f3349edc522c99f3b9585d9.tar.gz
devfs: let devfs_add_partition return the new partition
Useful for unregistering later or for adding addional flags. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/boards/x86_generic/generic_pc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c
index e49354b..9d37069 100644
--- a/arch/x86/boards/x86_generic/generic_pc.c
+++ b/arch/x86/boards/x86_generic/generic_pc.c
@@ -25,6 +25,7 @@
#include <init.h>
#include <asm/syslib.h>
#include <ns16550.h>
+#include <linux/err.h>
/*
* These datas are from the MBR, created by the linker and filled by the
@@ -43,6 +44,7 @@ extern uint8_t pers_env_drive;
static int devices_init(void)
{
int rc;
+ struct cdev *cdev;
/* extended memory only */
add_mem_device("ram0", 0x0, bios_get_memsize() << 10,
@@ -51,11 +53,11 @@ static int devices_init(void)
NULL);
if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) {
- rc = devfs_add_partition("biosdisk0",
+ cdev = devfs_add_partition("biosdisk0",
pers_env_storage * 512,
(unsigned)pers_env_size * 512,
DEVFS_PARTITION_FIXED, "env0");
- printf("Partition: %d\n", rc);
+ printf("Partition: %d\n", IS_ERR(cdev) ? PTR_ERR(cdev) : 0);
} else
printf("No persistent storage defined\n");