aboutsummaryrefslogtreecommitdiff
path: root/include/hw/sd
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /include/hw/sd
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw/sd')
-rw-r--r--include/hw/sd/allwinner-sdhost.h8
-rw-r--r--include/hw/sd/aspeed_sdhci.h4
-rw-r--r--include/hw/sd/bcm2835_sdhost.h4
-rw-r--r--include/hw/sd/sd.h12
-rw-r--r--include/hw/sd/sdhci.h7
5 files changed, 14 insertions, 21 deletions
diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdhost.h
index b23de2c548..7bccc06d1c 100644
--- a/include/hw/sd/allwinner-sdhost.h
+++ b/include/hw/sd/allwinner-sdhost.h
@@ -47,12 +47,8 @@
typedef struct AwSdHostClass AwSdHostClass;
typedef struct AwSdHostState AwSdHostState;
-#define AW_SDHOST(obj) \
- OBJECT_CHECK(AwSdHostState, (obj), TYPE_AW_SDHOST)
-#define AW_SDHOST_CLASS(klass) \
- OBJECT_CLASS_CHECK(AwSdHostClass, (klass), TYPE_AW_SDHOST)
-#define AW_SDHOST_GET_CLASS(obj) \
- OBJECT_GET_CLASS(AwSdHostClass, (obj), TYPE_AW_SDHOST)
+DECLARE_OBJ_CHECKERS(AwSdHostState, AwSdHostClass,
+ AW_SDHOST, TYPE_AW_SDHOST)
/** @} */
diff --git a/include/hw/sd/aspeed_sdhci.h b/include/hw/sd/aspeed_sdhci.h
index 527075476b..783ccc2956 100644
--- a/include/hw/sd/aspeed_sdhci.h
+++ b/include/hw/sd/aspeed_sdhci.h
@@ -14,8 +14,8 @@
#define TYPE_ASPEED_SDHCI "aspeed.sdhci"
typedef struct AspeedSDHCIState AspeedSDHCIState;
-#define ASPEED_SDHCI(obj) OBJECT_CHECK(AspeedSDHCIState, (obj), \
- TYPE_ASPEED_SDHCI)
+DECLARE_INSTANCE_CHECKER(AspeedSDHCIState, ASPEED_SDHCI,
+ TYPE_ASPEED_SDHCI)
#define ASPEED_SDHCI_CAPABILITIES 0x01E80080
#define ASPEED_SDHCI_NUM_SLOTS 2
diff --git a/include/hw/sd/bcm2835_sdhost.h b/include/hw/sd/bcm2835_sdhost.h
index 233e74b002..751ba531d6 100644
--- a/include/hw/sd/bcm2835_sdhost.h
+++ b/include/hw/sd/bcm2835_sdhost.h
@@ -20,8 +20,8 @@
#define TYPE_BCM2835_SDHOST "bcm2835-sdhost"
typedef struct BCM2835SDHostState BCM2835SDHostState;
-#define BCM2835_SDHOST(obj) \
- OBJECT_CHECK(BCM2835SDHostState, (obj), TYPE_BCM2835_SDHOST)
+DECLARE_INSTANCE_CHECKER(BCM2835SDHostState, BCM2835_SDHOST,
+ TYPE_BCM2835_SDHOST)
#define BCM2835_SDHOST_FIFO_LEN 16
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index 850740ea92..31ccbeab0e 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -94,11 +94,8 @@ typedef struct SDBus SDBus;
#define TYPE_SD_CARD "sd-card"
typedef struct SDCardClass SDCardClass;
-#define SD_CARD(obj) OBJECT_CHECK(SDState, (obj), TYPE_SD_CARD)
-#define SD_CARD_CLASS(klass) \
- OBJECT_CLASS_CHECK(SDCardClass, (klass), TYPE_SD_CARD)
-#define SD_CARD_GET_CLASS(obj) \
- OBJECT_GET_CLASS(SDCardClass, (obj), TYPE_SD_CARD)
+DECLARE_OBJ_CHECKERS(SDState, SDCardClass,
+ SD_CARD, TYPE_SD_CARD)
struct SDCardClass {
/*< private >*/
@@ -134,9 +131,8 @@ struct SDCardClass {
#define TYPE_SD_BUS "sd-bus"
typedef struct SDBusClass SDBusClass;
-#define SD_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SD_BUS)
-#define SD_BUS_CLASS(klass) OBJECT_CLASS_CHECK(SDBusClass, (klass), TYPE_SD_BUS)
-#define SD_BUS_GET_CLASS(obj) OBJECT_GET_CLASS(SDBusClass, (obj), TYPE_SD_BUS)
+DECLARE_OBJ_CHECKERS(SDBus, SDBusClass,
+ SD_BUS, TYPE_SD_BUS)
struct SDBus {
BusState qbus;
diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h
index 67b01fcb28..01a64c5442 100644
--- a/include/hw/sd/sdhci.h
+++ b/include/hw/sd/sdhci.h
@@ -115,11 +115,12 @@ typedef struct SDHCIState SDHCIState;
#define SDHCI_QUIRK_NO_BUSY_IRQ BIT(14)
#define TYPE_PCI_SDHCI "sdhci-pci"
-#define PCI_SDHCI(obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI)
+DECLARE_INSTANCE_CHECKER(SDHCIState, PCI_SDHCI,
+ TYPE_PCI_SDHCI)
#define TYPE_SYSBUS_SDHCI "generic-sdhci"
-#define SYSBUS_SDHCI(obj) \
- OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI)
+DECLARE_INSTANCE_CHECKER(SDHCIState, SYSBUS_SDHCI,
+ TYPE_SYSBUS_SDHCI)
#define TYPE_IMX_USDHC "imx-usdhc"