summaryrefslogtreecommitdiffstats
path: root/src/drivers/ata
diff options
context:
space:
mode:
authorMichael Brown2007-01-16 09:10:54 +0100
committerMichael Brown2007-01-16 09:10:54 +0100
commitff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6 (patch)
treebae0e953c128a5d49bedd2f502325b938078635f /src/drivers/ata
parentWhen a network device is specified to tcpip_tx() or it's children, treat (diff)
downloadipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.tar.gz
ipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.tar.xz
ipxe-ff8528ea9a69ca2ef6cfbed0b7a1283e165aabe6.zip
Create and use async_block() macro; it cuts down on the visual overhead
of blocking on asynchronous operations, when that isn't an important aspect of the code.
Diffstat (limited to 'src/drivers/ata')
-rw-r--r--src/drivers/ata/aoedev.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/drivers/ata/aoedev.c b/src/drivers/ata/aoedev.c
index 6658827cf..ff047f103 100644
--- a/src/drivers/ata/aoedev.c
+++ b/src/drivers/ata/aoedev.c
@@ -17,6 +17,7 @@
*/
#include <stddef.h>
+#include <gpxe/async.h>
#include <gpxe/aoe.h>
/** @file
@@ -37,13 +38,9 @@ static int aoe_command ( struct ata_device *ata,
struct aoe_device *aoedev
= container_of ( ata, struct aoe_device, ata );
struct async async;
- int rc;
- async_init_orphan ( &async );
- if ( ( rc = aoe_issue ( &aoedev->aoe, command, &async ) ) != 0 )
- return rc;
- async_wait ( &async, &rc, 1 );
- return rc;
+ return async_block ( &async, aoe_issue ( &aoedev->aoe, command,
+ &async ) );
}
/**