qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] nand: Don't use qdev_create() in nand_init()
@ 2014-02-05 14:30 Andreas Färber
  2014-02-05 14:56 ` Igor Mammedov
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Färber @ 2014-02-05 14:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, peter.maydell, Peter Crosthwaite, Andreas Färber,
	Stefan Hajnoczi

Commit 7426aa72c36c908a7d0eae3e38568bb0a70de479 (nand: Don't inherit
from Sysbus) changed the parent type of TYPE_NAND but continued to use
qdev_create(), which handled a NULL BusState as SysBus.

Use object_new() instead, and reuse the TYPE_NAND define while at it.

Reported-by: Markus Armbruster <armbru@redhat.com>
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/block/nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/block/nand.c b/hw/block/nand.c
index a871ce0..6d7c804 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -632,7 +632,7 @@ DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
     if (nand_flash_ids[chip_id].size == 0) {
         hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__);
     }
-    dev = qdev_create(NULL, "nand");
+    dev = DEVICE(object_new(TYPE_NAND));
     qdev_prop_set_uint8(dev, "manufacturer_id", manf_id);
     qdev_prop_set_uint8(dev, "chip_id", chip_id);
     if (bdrv) {
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] nand: Don't use qdev_create() in nand_init()
  2014-02-05 14:30 [Qemu-devel] [PATCH] nand: Don't use qdev_create() in nand_init() Andreas Färber
@ 2014-02-05 14:56 ` Igor Mammedov
  2014-02-08 17:32   ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Mammedov @ 2014-02-05 14:56 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Kevin Wolf, peter.maydell, Peter Crosthwaite, qemu-devel,
	Stefan Hajnoczi

On Wed,  5 Feb 2014 15:30:53 +0100
Andreas Färber <afaerber@suse.de> wrote:

> Commit 7426aa72c36c908a7d0eae3e38568bb0a70de479 (nand: Don't inherit
> from Sysbus) changed the parent type of TYPE_NAND but continued to use
> qdev_create(), which handled a NULL BusState as SysBus.
> 
> Use object_new() instead, and reuse the TYPE_NAND define while at it.
> 
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  hw/block/nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/block/nand.c b/hw/block/nand.c
> index a871ce0..6d7c804 100644
> --- a/hw/block/nand.c
> +++ b/hw/block/nand.c
> @@ -632,7 +632,7 @@ DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
>      if (nand_flash_ids[chip_id].size == 0) {
>          hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__);
>      }
> -    dev = qdev_create(NULL, "nand");
> +    dev = DEVICE(object_new(TYPE_NAND));
>      qdev_prop_set_uint8(dev, "manufacturer_id", manf_id);
>      qdev_prop_set_uint8(dev, "chip_id", chip_id);
>      if (bdrv) {
> -- 
> 1.8.4.5
> 
>

Reviewed-By: Igor Mammedov <imammedo@redhat.com>

-- 
Regards,
  Igor

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] nand: Don't use qdev_create() in nand_init()
  2014-02-05 14:56 ` Igor Mammedov
@ 2014-02-08 17:32   ` Andreas Färber
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2014-02-08 17:32 UTC (permalink / raw)
  To: Igor Mammedov, Paolo Bonzini
  Cc: Kevin Wolf, peter.maydell, Peter Crosthwaite, qemu-devel,
	Stefan Hajnoczi

Am 05.02.2014 15:56, schrieb Igor Mammedov:
> On Wed,  5 Feb 2014 15:30:53 +0100
> Andreas Färber <afaerber@suse.de> wrote:
> 
>> Commit 7426aa72c36c908a7d0eae3e38568bb0a70de479 (nand: Don't inherit
>> from Sysbus) changed the parent type of TYPE_NAND but continued to use
>> qdev_create(), which handled a NULL BusState as SysBus.
>>
>> Use object_new() instead, and reuse the TYPE_NAND define while at it.
>>
>> Reported-by: Markus Armbruster <armbru@redhat.com>
>> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>>  hw/block/nand.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/block/nand.c b/hw/block/nand.c
>> index a871ce0..6d7c804 100644
>> --- a/hw/block/nand.c
>> +++ b/hw/block/nand.c
>> @@ -632,7 +632,7 @@ DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
>>      if (nand_flash_ids[chip_id].size == 0) {
>>          hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__);
>>      }
>> -    dev = qdev_create(NULL, "nand");
>> +    dev = DEVICE(object_new(TYPE_NAND));
>>      qdev_prop_set_uint8(dev, "manufacturer_id", manf_id);
>>      qdev_prop_set_uint8(dev, "chip_id", chip_id);
>>      if (bdrv) {
>> -- 
>> 1.8.4.5
>>
>>
> 
> Reviewed-By: Igor Mammedov <imammedo@redhat.com>

Thanks, applied to qom-next:
https://github.com/afaerber/qemu-cpu/commits/qom-next

Paolo, if you want your "all three patches can be applied" to be
recorded, please reply with a proper tag!

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-08 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05 14:30 [Qemu-devel] [PATCH] nand: Don't use qdev_create() in nand_init() Andreas Färber
2014-02-05 14:56 ` Igor Mammedov
2014-02-08 17:32   ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).