summaryrefslogtreecommitdiffstats
path: root/common/block.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-09-27 16:32:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-09-30 10:18:39 +0200
commit4dda27ce490e13901e59f108db980052afefc4fb (patch)
tree1c1853e9b4c023ffb4fbdb805ad2a11b50c8d2fe /common/block.c
parent7a1c5027f998f20ee6b3a681903f64105a4e8014 (diff)
downloadbarebox-4dda27ce490e13901e59f108db980052afefc4fb.tar.gz
block: Collect block devices on list
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/block.c')
-rw-r--r--common/block.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/block.c b/common/block.c
index ab39a36..e522ee4 100644
--- a/common/block.c
+++ b/common/block.c
@@ -25,6 +25,8 @@
#define BLOCKSIZE(blk) (1 << blk->blockbits)
+LIST_HEAD(block_device_list);
+
/* a chunk of contigous data */
struct chunk {
void *data; /* data buffer */
@@ -367,6 +369,8 @@ int blockdevice_register(struct block_device *blk)
if (ret)
return ret;
+ list_add_tail(&blk->list, &block_device_list);
+
return 0;
}
@@ -387,6 +391,7 @@ int blockdevice_unregister(struct block_device *blk)
}
devfs_remove(&blk->cdev);
+ list_del(&blk->list);
return 0;
}