summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2013-07-25 13:21:48 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2013-07-25 13:21:48 +1000
commitd464fc598a356f48d509db047017b213f115a1d6 (patch)
tree32c57599f30555f6704ad81e1aa880507f33648c /block
parent947b1a86027dd1fe603acb6556324e1f40b2414d (diff)
parente284f3493206d4268267db4557c7ee6f89ed2314 (diff)
Merge remote-tracking branch 'bcon/master'
Conflicts: drivers/block/Kconfig
Diffstat (limited to 'block')
-rw-r--r--block/partitions/Makefile1
-rw-r--r--block/partitions/blockconsole.c22
-rw-r--r--block/partitions/check.c3
-rw-r--r--block/partitions/check.h3
4 files changed, 29 insertions, 0 deletions
diff --git a/block/partitions/Makefile b/block/partitions/Makefile
index 2be4d7ba4e3a..d79da0be0b2d 100644
--- a/block/partitions/Makefile
+++ b/block/partitions/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_IBM_PARTITION) += ibm.o
obj-$(CONFIG_EFI_PARTITION) += efi.o
obj-$(CONFIG_KARMA_PARTITION) += karma.o
obj-$(CONFIG_SYSV68_PARTITION) += sysv68.o
+obj-$(CONFIG_BLOCKCONSOLE) += blockconsole.o
diff --git a/block/partitions/blockconsole.c b/block/partitions/blockconsole.c
new file mode 100644
index 000000000000..79796a8799e9
--- /dev/null
+++ b/block/partitions/blockconsole.c
@@ -0,0 +1,22 @@
+#include <linux/blockconsole.h>
+
+#include "check.h"
+
+int blockconsole_partition(struct parsed_partitions *state)
+{
+ Sector sect;
+ void *data;
+ int err = 0;
+
+ data = read_part_sector(state, 0, &sect);
+ if (!data)
+ return -EIO;
+ if (!bcon_magic_present(data))
+ goto out;
+
+ bcon_add(state->name);
+ err = 1;
+out:
+ put_dev_sector(sect);
+ return err;
+}
diff --git a/block/partitions/check.c b/block/partitions/check.c
index 19ba207ea7d1..21786ed8876e 100644
--- a/block/partitions/check.c
+++ b/block/partitions/check.c
@@ -42,6 +42,9 @@ static int (*check_part[])(struct parsed_partitions *) = {
* Probe partition formats with tables at disk address 0
* that also have an ADFS boot block at 0xdc0.
*/
+#ifdef CONFIG_BLOCKCONSOLE
+ blockconsole_partition,
+#endif
#ifdef CONFIG_ACORN_PARTITION_ICS
adfspart_check_ICS,
#endif
diff --git a/block/partitions/check.h b/block/partitions/check.h
index eade17ea910b..bca962498642 100644
--- a/block/partitions/check.h
+++ b/block/partitions/check.h
@@ -52,3 +52,6 @@ put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size)
extern int warn_no_part;
+#ifdef CONFIG_BLOCKCONSOLE
+int blockconsole_partition(struct parsed_partitions *state);
+#endif