diff mbox

[for-1.4?] isa: QOM'ify isa_bus_from_device()

Message ID 1358704579-15210-1-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber Jan. 20, 2013, 5:56 p.m. UTC
DeviceState::parent_bus is document as private and should be accessed
through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing
ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
---
 hw/isa.h |    2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Comments

Andreas Färber Jan. 20, 2013, 6:16 p.m. UTC | #1
Am 20.01.2013 18:56, schrieb Andreas Färber:
> DeviceState::parent_bus is document as private and should be accessed

"documented" - please fix when applying.

> through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing
> ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
> ---
>  hw/isa.h |    2 +-
>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
> 
> diff --git a/hw/isa.h b/hw/isa.h
> index 62e89d3..7a8874a 100644
> --- a/hw/isa.h
> +++ b/hw/isa.h
> @@ -82,7 +82,7 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
>  
>  static inline ISABus *isa_bus_from_device(ISADevice *d)
>  {
> -    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
> +    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
>  }
>  
>  extern hwaddr isa_mem_base;
Andreas Färber Feb. 1, 2013, 9:06 a.m. UTC | #2
Am 20.01.2013 19:16, schrieb Andreas Färber:
> Am 20.01.2013 18:56, schrieb Andreas Färber:
>> DeviceState::parent_bus is document as private and should be accessed
> 
> "documented" - please fix when applying.
> 
>> through qdev_get_parent_bus(). Use a DEVICE() cast instead of accessing
>> ISADevice's qdev field directly. Use ISA_BUS() in place of DO_UPCAST().
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> Cc: Anthony Liguori <anthony@codemonkey.ws>
>> ---
>>  hw/isa.h |    2 +-
>>  1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

Ping? Not 1.4 material or an oversight? Should I resend due to typo?

Andreas

>> diff --git a/hw/isa.h b/hw/isa.h
>> index 62e89d3..7a8874a 100644
>> --- a/hw/isa.h
>> +++ b/hw/isa.h
>> @@ -82,7 +82,7 @@ void isa_register_portio_list(ISADevice *dev, uint16_t start,
>>  
>>  static inline ISABus *isa_bus_from_device(ISADevice *d)
>>  {
>> -    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
>> +    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
>>  }
>>  
>>  extern hwaddr isa_mem_base;
Anthony Liguori Feb. 4, 2013, 10:54 p.m. UTC | #3
Applied.  Thanks.

Regards,

Anthony Liguori
diff mbox

Patch

diff --git a/hw/isa.h b/hw/isa.h
index 62e89d3..7a8874a 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -82,7 +82,7 @@  void isa_register_portio_list(ISADevice *dev, uint16_t start,
 
 static inline ISABus *isa_bus_from_device(ISADevice *d)
 {
-    return DO_UPCAST(ISABus, qbus, d->qdev.parent_bus);
+    return ISA_BUS(qdev_get_parent_bus(DEVICE(d)));
 }
 
 extern hwaddr isa_mem_base;