[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 03/42] esp: QOMify the internal ESP device state
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 03/42] esp: QOMify the internal ESP device state |
Date: |
Fri, 12 Feb 2021 19:51:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/9/21 8:29 PM, Mark Cave-Ayland wrote:
> Make this new QOM device state a child device of both the sysbus-esp and
> esp-pci
> implementations.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/scsi/esp-pci.c | 48 +++++++++++++++++++++++++++++++------------
> hw/scsi/esp.c | 45 +++++++++++++++++++++++++++++++++-------
> include/hw/scsi/esp.h | 5 +++++
> 3 files changed, 78 insertions(+), 20 deletions(-)
Please setup scripts/git.orderfile ;)
...
> @@ -354,9 +365,11 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error
> **errp)
> {
> PCIESPState *pci = PCI_ESP(dev);
> DeviceState *d = DEVICE(dev);
> - ESPState *s = &pci->esp;
> + ESPState *s = ESP(&pci->esp);
> uint8_t *pci_conf;
>
> + qdev_realize(DEVICE(s), NULL, errp);
if (!qdev_realize(DEVICE(s), NULL, errp)) {
return;
}
> pci_conf = dev->config;
>
> /* Interrupt pin A */
> @@ -375,11 +388,19 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error
> **errp)
> scsi_bus_new(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info, NULL);
> }
...
> @@ -956,7 +958,9 @@ static void sysbus_esp_realize(DeviceState *dev, Error
> **errp)
> {
> SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> SysBusESPState *sysbus = SYSBUS_ESP(dev);
> - ESPState *s = &sysbus->esp;
> + ESPState *s = ESP(&sysbus->esp);
> +
> + qdev_realize(DEVICE(s), NULL, errp);
if (!qdev_realize(DEVICE(s), NULL, errp)) {
return;
}
With both if():
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
- [PATCH v2 00/42] esp: consolidate PDMA transfer buffers and other fixes, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 01/42] esp: checkpatch fixes, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 02/42] esp: rename existing ESP QOM type to SYSBUS_ESP, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 03/42] esp: QOMify the internal ESP device state, Mark Cave-Ayland, 2021/02/09
- Re: [PATCH v2 03/42] esp: QOMify the internal ESP device state,
Philippe Mathieu-Daudé <=
- [PATCH v2 04/42] esp: add vmstate_esp version to embedded ESPState, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 05/42] esp: add trace event when receiving a TI command, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 06/42] esp: fix esp_reg_read() trace event, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 07/42] esp: add PDMA trace events, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 08/42] esp: determine transfer direction directly from SCSI phase, Mark Cave-Ayland, 2021/02/09
- [PATCH v2 09/42] esp: introduce esp_get_tc() and esp_set_tc(), Mark Cave-Ayland, 2021/02/09
- [PATCH v2 10/42] esp: introduce esp_get_stc(), Mark Cave-Ayland, 2021/02/09