mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
blockdev: New drive_get_next(), replacing qdev_init_bdrv()
qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, not qdevs. Rename to drive_get_next, move to blockdev.c, drop the bogus DeviceState argument, and return DriveInfo instead of BlockDriverState. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
1869a65385
commit
13839974d1
6 changed files with 19 additions and 22 deletions
|
@ -7,6 +7,7 @@
|
|||
* This code is licenced under the GPL.
|
||||
*/
|
||||
|
||||
#include "blockdev.h"
|
||||
#include "sysbus.h"
|
||||
#include "sd.h"
|
||||
|
||||
|
@ -449,15 +450,15 @@ static int pl181_init(SysBusDevice *dev)
|
|||
{
|
||||
int iomemtype;
|
||||
pl181_state *s = FROM_SYSBUS(pl181_state, dev);
|
||||
BlockDriverState *bd;
|
||||
DriveInfo *dinfo;
|
||||
|
||||
iomemtype = cpu_register_io_memory(pl181_readfn, pl181_writefn, s,
|
||||
DEVICE_NATIVE_ENDIAN);
|
||||
sysbus_init_mmio(dev, 0x1000, iomemtype);
|
||||
sysbus_init_irq(dev, &s->irq[0]);
|
||||
sysbus_init_irq(dev, &s->irq[1]);
|
||||
bd = qdev_init_bdrv(&dev->qdev, IF_SD);
|
||||
s->card = sd_init(bd, 0);
|
||||
dinfo = drive_get_next(IF_SD);
|
||||
s->card = sd_init(dinfo ? dinfo->bdrv : NULL, 0);
|
||||
qemu_register_reset(pl181_reset, s);
|
||||
pl181_reset(s);
|
||||
/* ??? Save/restore. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue