From f1bd51ac2b6e6ccd3d13dfd52c1c381a68bf261c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 28 Jan 2011 11:21:44 +0100 Subject: blockdev: New drive_get_by_index() Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- blockdev.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index a42c5e4a62..01228f6200 100644 --- a/blockdev.c +++ b/blockdev.c @@ -136,6 +136,13 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit) return NULL; } +DriveInfo *drive_get_by_index(BlockInterfaceType type, int index) +{ + return drive_get(type, + drive_index_to_bus_id(type, index), + drive_index_to_unit_id(type, index)); +} + int drive_get_max_bus(BlockInterfaceType type) { int max_bus; -- cgit v1.2.3-55-g7522