Modified rootdev to handle stacked device mappers
Rootdev only went down one level when traversing the device tree.
With the addition of the bootcache device mapper, we need to
go multiple levels for the -s option for rootdev.
BUG=chromium-os:25441
TEST=used it with bootcache to find boot device.
Change-Id: Ica82dc150e403d0e49e4d8074c0b920b20e4cccc
Reviewed-on: https://gerrit.chromium.org/gerrit/31851
Commit-Ready: Paul Taysom <taysom@chromium.org>
Reviewed-by: Paul Taysom <taysom@chromium.org>
Tested-by: Paul Taysom <taysom@chromium.org>
diff --git a/rootdev.h b/rootdev.h
index 03b8bd8..74a48da 100644
--- a/rootdev.h
+++ b/rootdev.h
@@ -61,11 +61,10 @@
* @device: name of the device to probe, like "sdb"
* @search: path to search under. NULL for default.
*
- * Returns 0 on success, non-zero on failure.
* It is safe for @device == @slave.
*/
-int rootdev_get_device_slave(char *slave, size_t size, dev_t *dev,
- const char *device, const char *search);
+void rootdev_get_device_slave(char *slave, size_t size, dev_t *dev,
+ const char *device, const char *search);
/**
* rootdev_get_path: converts a device name to a path in the device tree