Skip to content

Commit

Permalink
etraxfs_eth: Don't use hw_error() in init() method
Browse files Browse the repository at this point in the history
Device init() methods aren't supposed to call hw_error(), they should
report the error and fail cleanly.  Do that.

Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-Id: <1450370121-5768-5-git-send-email-armbru@redhat.com>
  • Loading branch information
Markus Armbruster committed Jan 13, 2016
1 parent b097e48 commit 5a8de10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hw/net/etraxfs_eth.c
Expand Up @@ -26,6 +26,7 @@
#include "hw/sysbus.h"
#include "net/net.h"
#include "hw/cris/etraxfs.h"
#include "qemu/error-report.h"

#define D(x)

Expand Down Expand Up @@ -589,7 +590,8 @@ static int fs_eth_init(SysBusDevice *sbd)
ETRAXFSEthState *s = ETRAX_FS_ETH(dev);

if (!s->dma_out || !s->dma_in) {
hw_error("Unconnected ETRAX-FS Ethernet MAC.\n");
error_report("Unconnected ETRAX-FS Ethernet MAC");
return -1;
}

s->dma_out->client.push = eth_tx_push;
Expand Down

0 comments on commit 5a8de10

Please sign in to comment.