From patchwork Mon Sep 18 19:50:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9957583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F5CA60568 for ; Mon, 18 Sep 2017 20:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51F7328C0E for ; Mon, 18 Sep 2017 20:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46D2C28C7D; Mon, 18 Sep 2017 20:01:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D65AE28D6E for ; Mon, 18 Sep 2017 20:01:02 +0000 (UTC) Received: from localhost ([::1]:38655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du2DX-0005GX-8j for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Sep 2017 16:00:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du24r-0006lU-58 for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du24q-0006Ga-8P for qemu-devel@nongnu.org; Mon, 18 Sep 2017 15:51:33 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:36998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1du24l-0006E4-Us; Mon, 18 Sep 2017 15:51:28 -0400 Received: by mail-pg0-x242.google.com with SMTP id v5so767411pgn.4; Mon, 18 Sep 2017 12:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PPFJJFGlz6LRNHc5NYzxKFNjJDNoIVP9JQBS0o4H3QE=; b=lITy7IMEvHkQjyM34xV2lrEPZ1FRqo2tqMg3i7lTkeyK7W6V8OyXI8YBMzD9Y6I22m uTd+l3io7YD6OH652Z0SKvXRflsByIAzAk3eEsmcogB7rYZPy6j9OL0ExzGW319LDl9L R/DyiKLx7aKbOgzOlMAmkcqvVFXKUPO7R1l5nCb9QhZ3+3F70clfklV2mR2N8EXMJles givaXJ/03UBUKTRUdnH9qooFu2WLOnm9TIewMQE4F38EJd2HxoATPBYk/lD5nnkDVi0R ReqS2dBlB62cR7bp913gFUZyXODhBC1545ndtZkIK2OuQ7tzP13S5BDOLRRHPf9q+Wrs kC6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PPFJJFGlz6LRNHc5NYzxKFNjJDNoIVP9JQBS0o4H3QE=; b=p6MhJ3AVTBmF1eOHLfPzjMw+L6BKI8i8Fa6+gcUXghJe5AtnftqJQGDmm2e5A+yJZC Ayy2l21QDtvRLDeTEJlvNb9xRylcw4WRdydqBi+rutaX/w4ssv7ccQSL3GShqX25D00m 0R01cSxRwYOH5iFQdPnFU654B2z3kbxq+nwDRXYvo+EBETVMPlpqlv53FqeHQZcRZcPG 261YNpY6Q8Fe+NpvjPF3uSV2RvTLvl8dQHZvDBWXwmuPdr4hy5aPianB822J/nR1I2bI 9Imb7t9fl+W56iakgpTciLBMnEa7HxzQxBBSNys4I5c/edYazAn2AaECOmGrJpRizuMI R0Gg== X-Gm-Message-State: AHPjjUi+G511n7QZPihgjqHRGW9XAoD8BMhzUxaS8RTITH7GhKJPRIuh 4BAA6H6lrcb1nPdNovg= X-Google-Smtp-Source: AOwi7QBnlrdV2dAjPJ5o6XU0B1ZZT9VKBl9Vuwn1QtXL8E3m1hY6XRJ/FKEnoE1O67FGru4a6K14rw== X-Received: by 10.84.211.36 with SMTP id b33mr24405445pli.47.1505764285554; Mon, 18 Sep 2017 12:51:25 -0700 (PDT) Received: from squirtle.westlake.spaceflightindustries.com ([173.226.206.194]) by smtp.gmail.com with ESMTPSA id d186sm200791pfd.117.2017.09.18.12.51.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Sep 2017 12:51:25 -0700 (PDT) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Mon, 18 Sep 2017 12:50:44 -0700 Message-Id: <20170918195100.17593-2-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170918195100.17593-1-andrew.smirnov@gmail.com> References: <20170918195100.17593-1-andrew.smirnov@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH 01/17] imx_fec: Do not link to netdev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , Peter Maydell , Jason Wang , qemu-devel@nongnu.org, yurovsky@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Binding to a particular netdev doesn't seem to belong to this layer and should probably be done as a part of board or SoC specific code. Convert all of the users of this IP block to use qdev_set_nic_properties() instead. Cc: Peter Maydell Cc: Jason Wang Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Signed-off-by: Andrey Smirnov Reviewed-by: Peter Maydell --- hw/arm/fsl-imx6.c | 1 + hw/net/imx_fec.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 26fd214004..2ed7146c52 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -385,6 +385,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) spi_table[i].irq)); } + qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]); object_property_set_bool(OBJECT(&s->eth), true, "realized", &err); if (err) { error_propagate(errp, err); diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 90e6ee35ba..88b4b049d7 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -1171,8 +1171,6 @@ static void imx_eth_realize(DeviceState *dev, Error **errp) qemu_macaddr_default_if_unset(&s->conf.macaddr); - s->conf.peers.ncs[0] = nd_table[0].netdev; - s->nic = qemu_new_nic(&imx_eth_net_info, &s->conf, object_get_typename(OBJECT(dev)), DEVICE(dev)->id, s);