hw/sd/sdcard: Extract TYPE_SDMMC_COMMON from TYPE_SD_CARD

In order to keep eMMC model simpler to maintain,
extract common properties and the common code from
class_init to the (internal) TYPE_SDMMC_COMMON.

Update the corresponding QOM cast macros.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Tested-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20240703134356.85972-6-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2024-07-03 11:12:00 +02:00
parent 5241b759bc
commit 0bcea3f74b
3 changed files with 53 additions and 30 deletions

View file

@ -11,6 +11,9 @@
#ifndef SDMMC_INTERNAL_H
#define SDMMC_INTERNAL_H
#define TYPE_SDMMC_COMMON "sdmmc-common"
DECLARE_OBJ_CHECKERS(SDState, SDCardClass, SDMMC_COMMON, TYPE_SDMMC_COMMON)
/*
* EXT_CSD Modes segment
*