diff mbox

[v2,1/2] dec: convert to realize()

Message ID 1450944525-5014-2-git-send-email-caoj.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Cao jin Dec. 24, 2015, 8:08 a.m. UTC
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
 hw/pci-bridge/dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Markus Armbruster Jan. 11, 2016, 7:07 p.m. UTC | #1
Cao jin <caoj.fnst@cn.fujitsu.com> writes:

> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
>  hw/pci-bridge/dec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index 28d0ff9..be0fc46 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -51,9 +51,9 @@ static int dec_map_irq(PCIDevice *pci_dev, int irq_num)
>      return irq_num;
>  }
>  
> -static int dec_pci_bridge_initfn(PCIDevice *pci_dev)
> +static void dec_pci_bridge_realize(PCIDevice *pci_dev, Error **errp)
>  {
> -    return pci_bridge_initfn(pci_dev, TYPE_PCI_BUS);
> +    pci_bridge_initfn(pci_dev, TYPE_PCI_BUS);
>  }
>  
>  static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
> @@ -61,7 +61,7 @@ static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->init = dec_pci_bridge_initfn;
> +    k->realize = dec_pci_bridge_realize;
>      k->exit = pci_bridge_exitfn;
>      k->vendor_id = PCI_VENDOR_ID_DEC;
>      k->device_id = PCI_DEVICE_ID_DEC_21154;

Correct because pci_bridge_initfn() can't fail.  Suggest to mention that
in the commit message.
Cao jin Jan. 12, 2016, 3:17 a.m. UTC | #2
On 01/12/2016 03:07 AM, Markus Armbruster wrote:
> Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>
[...]
>
> Correct because pci_bridge_initfn() can't fail.  Suggest to mention that
> in the commit message.

Ok, thanks for suggestion:)
diff mbox

Patch

diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
index 28d0ff9..be0fc46 100644
--- a/hw/pci-bridge/dec.c
+++ b/hw/pci-bridge/dec.c
@@ -51,9 +51,9 @@  static int dec_map_irq(PCIDevice *pci_dev, int irq_num)
     return irq_num;
 }
 
-static int dec_pci_bridge_initfn(PCIDevice *pci_dev)
+static void dec_pci_bridge_realize(PCIDevice *pci_dev, Error **errp)
 {
-    return pci_bridge_initfn(pci_dev, TYPE_PCI_BUS);
+    pci_bridge_initfn(pci_dev, TYPE_PCI_BUS);
 }
 
 static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
@@ -61,7 +61,7 @@  static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
 
-    k->init = dec_pci_bridge_initfn;
+    k->realize = dec_pci_bridge_realize;
     k->exit = pci_bridge_exitfn;
     k->vendor_id = PCI_VENDOR_ID_DEC;
     k->device_id = PCI_DEVICE_ID_DEC_21154;