[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PULL 34/45] net: etraxfs_eth: convert SysBus init method
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PULL 34/45] net: etraxfs_eth: convert SysBus init method to a realize method |
Date: |
Tue, 23 Oct 2018 16:22:44 +0100 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Oct 18, 2018 at 05:04:11PM -0300, Eduardo Habkost wrote:
> From: Cédric Le Goater <address@hidden>
>
> Cc: Edgar E. Iglesias <address@hidden>
> Signed-off-by: Cédric Le Goater <address@hidden>
> Reviewed-by: Peter Maydell <address@hidden>
> Message-Id: <address@hidden>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> hw/net/etraxfs_eth.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c
> index a6932432b1..64ab3df1ae 100644
> --- a/hw/net/etraxfs_eth.c
> +++ b/hw/net/etraxfs_eth.c
> @@ -23,6 +23,7 @@
> */
>
> #include "qemu/osdep.h"
> +#include "qapi/error.h"
> #include "hw/sysbus.h"
> #include "net/net.h"
> #include "hw/cris/etraxfs.h"
> @@ -584,14 +585,14 @@ static NetClientInfo net_etraxfs_info = {
> .link_status_changed = eth_set_link,
> };
>
> -static int fs_eth_init(SysBusDevice *sbd)
> +static void etraxfs_eth_realize(DeviceState *dev, Error **errp)
> {
> - DeviceState *dev = DEVICE(sbd);
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> ETRAXFSEthState *s = ETRAX_FS_ETH(dev);
>
> if (!s->dma_out || !s->dma_in) {
> - error_report("Unconnected ETRAX-FS Ethernet MAC");
> - return -1;
> + error_setg(errp, "Unconnected ETRAX-FS Ethernet MAC");
> + return;
> }
>
> s->dma_out->client.push = eth_tx_push;
> @@ -611,7 +612,6 @@ static int fs_eth_init(SysBusDevice *sbd)
>
> tdk_init(&s->phy);
> mdio_attach(&s->mdio_bus, &s->phy, s->phyaddr);
> - return 0;
> }
>
> static Property etraxfs_eth_properties[] = {
> @@ -625,9 +625,8 @@ static Property etraxfs_eth_properties[] = {
> static void etraxfs_eth_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>
> - k->init = fs_eth_init;
> + dc->realize = etraxfs_eth_realize;
> dc->props = etraxfs_eth_properties;
> /* Reason: pointer properties "dma_out", "dma_in" */
> dc->user_creatable = false;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- [Qemu-ppc] [PULL 25/45] memory-device: document MemoryDeviceClass, (continued)
- [Qemu-ppc] [PULL 25/45] memory-device: document MemoryDeviceClass, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 26/45] memory-device: add and use memory_device_get_region_size(), Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 27/45] memory-device: factor out get_memory_region() from pc-dimm, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 29/45] memory-device: add device class function set_addr(), Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 28/45] memory-device: drop get_region_size(), Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 31/45] memory-device: complete factoring out plug handling, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 30/45] memory-device: complete factoring out pre_plug handling, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 32/45] memory-device: complete factoring out unplug handling, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 33/45] memory-device: trace when pre_plugging/plugging/unplugging, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 34/45] net: etraxfs_eth: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- Re: [Qemu-ppc] [PULL 34/45] net: etraxfs_eth: convert SysBus init method to a realize method,
David Gibson <=
- [Qemu-ppc] [PULL 35/45] net: etraxfs_eth: add a reset method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 37/45] net: lance: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 36/45] net: lan9118: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 38/45] net: milkymist_minimac2: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 39/45] net: mipsnet: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18
- [Qemu-ppc] [PULL 40/45] net: opencores_eth: convert SysBus init method to a realize method, Eduardo Habkost, 2018/10/18