diff options
author | Markus Armbruster <armbru@redhat.com> | 2011-08-03 15:07:42 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-09-06 11:23:51 +0200 |
commit | 145feb176ffe6de1db6d05af064c841d7c16633c (patch) | |
tree | f69598e83c5a2b36fcecd043e7a234dcbeb77a2e /hw/sd.c | |
parent | 0e49de5232f47c9e58adb82c28d4f42be933d891 (diff) | |
download | qemu-145feb176ffe6de1db6d05af064c841d7c16633c.zip qemu-145feb176ffe6de1db6d05af064c841d7c16633c.tar.gz qemu-145feb176ffe6de1db6d05af064c841d7c16633c.tar.bz2 |
block: Split change_cb() into change_media_cb(), resize_cb()
Multiplexing callbacks complicates matters needlessly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/sd.c')
-rw-r--r-- | hw/sd.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -420,14 +420,10 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv) sd->pwd_len = 0; } -static void sd_cardchange(void *opaque, int reason) +static void sd_cardchange(void *opaque) { SDState *sd = opaque; - if (!(reason & CHANGE_MEDIA)) { - return; - } - qemu_set_irq(sd->inserted_cb, bdrv_is_inserted(sd->bdrv)); if (bdrv_is_inserted(sd->bdrv)) { sd_reset(sd, sd->bdrv); @@ -436,7 +432,7 @@ static void sd_cardchange(void *opaque, int reason) } static const BlockDevOps sd_block_ops = { - .change_cb = sd_cardchange, + .change_media_cb = sd_cardchange, }; /* We do not model the chip select pin, so allow the board to select |