diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-09-08 09:05:14 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-09-08 09:05:14 -0500 |
commit | 220724ca4ada4e30bcfff326b62822a69c23e181 (patch) | |
tree | c0bb1bdd3ec41c5945000cf43620725d2e00ffd8 /hw/sd.c | |
parent | d8ac46d950451a722fd6b1d5d0768c72bee87d47 (diff) | |
parent | cfc606da0ddcef1f7228317b9f7dfa6c94c6c64f (diff) | |
download | qemu-220724ca4ada4e30bcfff326b62822a69c23e181.zip qemu-220724ca4ada4e30bcfff326b62822a69c23e181.tar.gz qemu-220724ca4ada4e30bcfff326b62822a69c23e181.tar.bz2 |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'hw/sd.c')
-rw-r--r-- | hw/sd.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -31,7 +31,6 @@ #include "hw.h" #include "block.h" -#include "block_int.h" #include "sd.h" //#define DEBUG_SD 1 @@ -420,14 +419,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); @@ -435,6 +430,10 @@ static void sd_cardchange(void *opaque, int reason) } } +static const BlockDevOps sd_block_ops = { + .change_media_cb = sd_cardchange, +}; + /* We do not model the chip select pin, so allow the board to select whether card should be in SSI or MMC/SD mode. It is also up to the board to ensure that ssi transfers only occur when the chip select @@ -449,7 +448,8 @@ SDState *sd_init(BlockDriverState *bs, int is_spi) sd->enable = 1; sd_reset(sd, bs); if (sd->bdrv) { - bdrv_set_change_cb(sd->bdrv, sd_cardchange, sd); + bdrv_attach_dev_nofail(sd->bdrv, sd); + bdrv_set_dev_ops(sd->bdrv, &sd_block_ops, sd); } return sd; } |