[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/14] sdhci: refactor same sysbus/pci propertie
From: |
Alistair Francis |
Subject: |
Re: [Qemu-devel] [PATCH 06/14] sdhci: refactor same sysbus/pci properties into a common one |
Date: |
Thu, 14 Dec 2017 09:32:59 -0800 |
On Wed, Dec 13, 2017 at 11:58 AM, Philippe Mathieu-Daudé
<address@hidden> wrote:
> add sysbus/pci/sdbus separator comments to keep it clearer
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> 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 a56c0c273e..c8b7b1ca4c 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1256,13 +1256,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),
I like the reduction of code in this patch, but aren't we now going to
have device properties that aren't actually connected to anything?
Alistair
> DEFINE_PROP_END_OF_LIST(),
> };
>
> +/* --- qdev PCI --- */
> +
> static void sdhci_pci_realize(PCIDevice *dev, Error **errp)
> {
> SDHCIState *s = PCI_SDHCI(dev);
> @@ -1295,7 +1299,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;
> }
>
> @@ -1310,14 +1314,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)
> {
> @@ -1350,7 +1347,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;
> }
> @@ -1364,6 +1361,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
>
>
- Re: [Qemu-devel] [PATCH 04/14] sdhci: use deposit64(), (continued)
[Qemu-devel] [PATCH 03/14] sdhci: use the ldst_le_dma() API, Philippe Mathieu-Daudé, 2017/12/13
[Qemu-devel] [PATCH 05/14] sdhci: move MASK_TRNMOD with other SDHC_TRN* defines in "sd-internal.h", Philippe Mathieu-Daudé, 2017/12/13
[Qemu-devel] [PATCH 06/14] sdhci: refactor same sysbus/pci properties into a common one, Philippe Mathieu-Daudé, 2017/12/13
- Re: [Qemu-devel] [PATCH 06/14] sdhci: refactor same sysbus/pci properties into a common one,
Alistair Francis <=
[Qemu-devel] [PATCH 07/14] sdhci: refactor common sysbus/pci realize() into sdhci_realizefn(), Philippe Mathieu-Daudé, 2017/12/13
[Qemu-devel] [PATCH 08/14] sdhci: refactor common sysbus/pci class_init() into sdhci_class_init(), Philippe Mathieu-Daudé, 2017/12/13
[Qemu-devel] [PATCH 10/14] sdhci: use qemu_log_mask(UNIMP) instead of fprintf(), Philippe Mathieu-Daudé, 2017/12/13