aboutsummaryrefslogtreecommitdiff
path: root/hw/sd
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-07-03 16:59:46 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-07-03 16:59:46 +0100
commit213f63df77b08dc47dcb3df215749b46fd4d9e8c (patch)
treef74522cffdda5f5ad839619d3bff8b1f0b1ff277 /hw/sd
parent62a4d34020197e16e54ec79f7991a6acaedfecf6 (diff)
downloadqemu-213f63df77b08dc47dcb3df215749b46fd4d9e8c.zip
qemu-213f63df77b08dc47dcb3df215749b46fd4d9e8c.tar.gz
qemu-213f63df77b08dc47dcb3df215749b46fd4d9e8c.tar.bz2
Replace uses of FROM_SSI_SLAVE() macro with QOM casts
The FROM_SSI_SLAVE() macro predates QOM and is used as a typesafe way to cast from an SSISlave* to the instance struct of a subtype of TYPE_SSI_SLAVE. Switch to using the QOM cast macros instead, which have the same effect (by writing the QOM macros if the types were previously missing them.) (The FROM_SSI_SLAVE() macro allows the SSISlave member of the subtype's struct to be anywhere as long as it is named "ssidev", whereas a QOM cast macro insists that it is the first thing in the subtype's struct. This is true for all the types we convert here.) This removes all the uses of FROM_SSI_SLAVE() so we can delete the definition. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20200628142429.17111-18-peter.maydell@linaro.org
Diffstat (limited to 'hw/sd')
-rw-r--r--hw/sd/ssi-sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/sd/ssi-sd.c b/hw/sd/ssi-sd.c
index 25cec2d..25cdf4c 100644
--- a/hw/sd/ssi-sd.c
+++ b/hw/sd/ssi-sd.c
@@ -74,7 +74,7 @@ typedef struct {
static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val)
{
- ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, dev);
+ ssi_sd_state *s = SSI_SD(dev);
/* Special case: allow CMD12 (STOP TRANSMISSION) while reading data. */
if (s->mode == SSI_SD_DATA_READ && val == 0x4d) {
@@ -241,7 +241,7 @@ static const VMStateDescription vmstate_ssi_sd = {
static void ssi_sd_realize(SSISlave *d, Error **errp)
{
- ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
+ ssi_sd_state *s = SSI_SD(d);
DeviceState *carddev;
DriveInfo *dinfo;
Error *err = NULL;