[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 04/20] sdhci: refactor same sysbus
From: |
Alistair Francis |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 04/20] sdhci: refactor same sysbus/pci properties into a common one |
Date: |
Mon, 18 Dec 2017 17:13:21 -0800 |
On Thu, Dec 14, 2017 at 7:15 PM, Philippe Mathieu-Daudé <address@hidden> wrote:
> add sysbus/pci/sdbus separator comments to keep it clearer
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
I'm still unsure about this. Won't this leave us with properties that
have no impact on the device? That seems very confusing to me.
Alistair
> ---
> hw/sd/sdhci.c | 21 ++++++++++-----------
> 1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 2823da00da..dbdfd54350 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1265,13 +1265,17 @@ const VMStateDescription sdhci_vmstate = {
>
> /* Capabilities registers provide information on supported features of this
> * specific host controller implementation */
> -static Property sdhci_pci_properties[] = {
> +static Property sdhci_properties[] = {
> DEFINE_PROP_UINT32("capareg", SDHCIState, capareg,
> SDHC_CAPAB_REG_DEFAULT),
> DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0),
> + DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState,
> pending_insert_quirk,
> + false),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> +/* --- qdev PCI --- */
> +
> static void sdhci_pci_realize(PCIDevice *dev, Error **errp)
> {
> SDHCIState *s = PCI_SDHCI(dev);
> @@ -1304,7 +1308,7 @@ static void sdhci_pci_class_init(ObjectClass *klass,
> void *data)
> k->class_id = PCI_CLASS_SYSTEM_SDHCI;
> set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
> dc->vmsd = &sdhci_vmstate;
> - dc->props = sdhci_pci_properties;
> + dc->props = sdhci_properties;
> dc->reset = sdhci_poweron_reset;
> }
>
> @@ -1319,14 +1323,7 @@ static const TypeInfo sdhci_pci_info = {
> },
> };
>
> -static Property sdhci_sysbus_properties[] = {
> - DEFINE_PROP_UINT32("capareg", SDHCIState, capareg,
> - SDHC_CAPAB_REG_DEFAULT),
> - DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0),
> - DEFINE_PROP_BOOL("pending-insert-quirk", SDHCIState,
> pending_insert_quirk,
> - false),
> - DEFINE_PROP_END_OF_LIST(),
> -};
> +/* --- qdev SysBus --- */
>
> static void sdhci_sysbus_init(Object *obj)
> {
> @@ -1359,7 +1356,7 @@ static void sdhci_sysbus_class_init(ObjectClass *klass,
> void *data)
> DeviceClass *dc = DEVICE_CLASS(klass);
>
> dc->vmsd = &sdhci_vmstate;
> - dc->props = sdhci_sysbus_properties;
> + dc->props = sdhci_properties;
> dc->realize = sdhci_sysbus_realize;
> dc->reset = sdhci_poweron_reset;
> }
> @@ -1373,6 +1370,8 @@ static const TypeInfo sdhci_sysbus_info = {
> .class_init = sdhci_sysbus_class_init,
> };
>
> +/* --- qdev bus master --- */
> +
> static void sdhci_bus_class_init(ObjectClass *klass, void *data)
> {
> SDBusClass *sbc = SD_BUS_CLASS(klass);
> --
> 2.15.1
>
>
- [Qemu-arm] [PATCH v2 00/20] SDHCI: housekeeping, add a qtest and fix few issues, Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 01/20] sdhci: clean up includes, Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 02/20] sdhci: use deposit64(), Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 03/20] sdhci: move MASK_TRNMOD with other SDHC_TRN* defines in "sd-internal.h", Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 04/20] sdhci: refactor same sysbus/pci properties into a common one, Philippe Mathieu-Daudé, 2017/12/14
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 04/20] sdhci: refactor same sysbus/pci properties into a common one,
Alistair Francis <=
- [Qemu-arm] [PATCH v2 05/20] sdhci: refactor common sysbus/pci realize() into sdhci_realizefn(), Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 06/20] sdhci: refactor common sysbus/pci class_init() into sdhci_class_init(), Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 07/20] sdhci: refactor common sysbus/pci unrealize() into sdhci_unrealizefn(), Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 08/20] sdhci: use qemu_log_mask(UNIMP) instead of fprintf(), Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 09/20] sdhci: convert the DPRINT() calls into trace events, Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 10/20] sdhci: add a GPIO for the access control LED, Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 11/20] sdhci: add a "dma-memory" property, Philippe Mathieu-Daudé, 2017/12/14
- [Qemu-arm] [PATCH v2 13/20] sdhci: Implement write method of ACMD12ERRSTS register, Philippe Mathieu-Daudé, 2017/12/14