Replace uses of FROM_SSI_SLAVE() macro with QOM casts
commit213f63df77b08dc47dcb3df215749b46fd4d9e8c
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Jul 2020 15:59:46 +0000 (3 16:59 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 3 Jul 2020 15:59:46 +0000 (3 16:59 +0100)
treef74522cffdda5f5ad839619d3bff8b1f0b1ff277
parent62a4d34020197e16e54ec79f7991a6acaedfecf6
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
hw/arm/z2.c
hw/display/ads7846.c
hw/display/ssd0323.c
hw/sd/ssi-sd.c
include/hw/ssi/ssi.h