From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Michael Walle" <michael@walle.cc>,
"Alistair Francis" <alistair@alistair23.me>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH 3/4] hw/sd/milkymist: Create the SDBus at init()
Date: Sun, 5 Jul 2020 23:10:15 +0200 [thread overview]
Message-ID: <20200705211016.15241-4-f4bug@amsat.org> (raw)
In-Reply-To: <20200705211016.15241-1-f4bug@amsat.org>
We don't need to wait until realize() to create the SDBus,
create it in init() directly.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/milkymist-memcard.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c
index afdb8aa0c0..fb02309f07 100644
--- a/hw/sd/milkymist-memcard.c
+++ b/hw/sd/milkymist-memcard.c
@@ -261,6 +261,9 @@ static void milkymist_memcard_init(Object *obj)
memory_region_init_io(&s->regs_region, OBJECT(s), &memcard_mmio_ops, s,
"milkymist-memcard", R_MAX * 4);
sysbus_init_mmio(dev, &s->regs_region);
+
+ qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
+ DEVICE(obj), "sd-bus");
}
static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
@@ -271,9 +274,6 @@ static void milkymist_memcard_realize(DeviceState *dev, Error **errp)
DriveInfo *dinfo;
Error *err = NULL;
- qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
- dev, "sd-bus");
-
/* Create and plug in the sd card */
/* FIXME use a qdev drive property instead of drive_get_next() */
dinfo = drive_get_next(IF_SD);
--
2.21.3
next prev parent reply other threads:[~2020-07-05 21:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-05 21:10 [PATCH 0/4] hw/sd/milkymist: Do not create SD card within the SDHCI controller Philippe Mathieu-Daudé
2020-07-05 21:10 ` [PATCH 1/4] hw/lm32/milkymist: Un-inline milkymist_memcard_create() Philippe Mathieu-Daudé
2020-07-06 16:17 ` Alistair Francis
2020-07-05 21:10 ` [PATCH 2/4] hw/lm32/milkymist: Comment to remember some IRQs lines are left unwired Philippe Mathieu-Daudé
2020-07-06 16:19 ` Alistair Francis
2020-07-06 18:04 ` Philippe Mathieu-Daudé
2020-07-06 18:32 ` Alistair Francis
2020-07-07 2:06 ` Philippe Mathieu-Daudé
2020-07-07 15:57 ` Alistair Francis
2020-07-07 16:30 ` Peter Maydell
2020-07-07 20:22 ` Michael Walle
2020-07-05 21:10 ` Philippe Mathieu-Daudé [this message]
2020-07-06 16:19 ` [PATCH 3/4] hw/sd/milkymist: Create the SDBus at init() Alistair Francis
2020-07-05 21:10 ` [PATCH 4/4] hw/sd/milkymist: Do not create SD card within the SDHCI controller Philippe Mathieu-Daudé
2020-07-06 16:21 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200705211016.15241-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alistair@alistair23.me \
--cc=michael@walle.cc \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).