From patchwork Mon Jul 15 19:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1132238 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="POeIw2LG"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45nZ2n183Qz9sDQ for ; Tue, 16 Jul 2019 05:53:21 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CB23EC21F99; Mon, 15 Jul 2019 19:53:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7EAE4C21EEF; Mon, 15 Jul 2019 19:53:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 697BAC21EEF; Mon, 15 Jul 2019 19:53:15 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 25262C21EDC for ; Mon, 15 Jul 2019 19:53:15 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id s3so16382805wms.2 for ; Mon, 15 Jul 2019 12:53:15 -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:mime-version :content-transfer-encoding; bh=4BMu4aHMfPkOrcq0bP8T5H+S7/f5sGU8yK5uQVemys0=; b=POeIw2LGZ2ND9y7Rw/+YDn1MaeuThwDJ/NrEo6qegpCGjqMjLsYoTwP31kSArWTLA5 HW4K+gVki8dSyqcLMDOf9vxzFEZZ+iR9cu3/trPailXeThmlvvmm+Z76kSm3OETNbSL2 ulIk22s+yPG6G/lGNsAn2yfyctRzAAwvOvwNq2uJjcLXK8J4CjCLLtMZKE5YKJOPx70j RBus6YjOt7UndsmbDpNWmrKIPy7K2hhH7SGMTV0ponbisK9pQDULnnEoHCDp58D1Ep1j bGtFuLOjGD6VshFszb9ByKYO5OAjSRClpOp1v81EIwfNxSH5efVi778lcc31TzuCmGhI nKPw== 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:mime-version :content-transfer-encoding; bh=4BMu4aHMfPkOrcq0bP8T5H+S7/f5sGU8yK5uQVemys0=; b=qfF9+xIIns2a3D1ujkDesgA9zF0wlVdISOGUrPNrcQQ4EkWgCw7iafRSt8X5MTMMEK dZgd79WlHZjfpD0aPeLpip7aE8FMxw6uDG6ajuNEm+UZb3bjFpimsb4dSphTYD9+1eg7 0RLuYz3C9MsXwZVFR8yzR1ehh7on/z7Narb7P/Kmjh7T4zXJqFC8puiGLAgFuD4lfXlB IQTEIE8Po2MhJ/RSzDXgDePp9vlZsV7/eyTqjHRj2M8KASZ3TE6gH9pR6+zQ1AoPfkqZ ck9Esg93wjvwgMULSp8Ps+nmsuiMARjZn9hjNxB74N4joJIkiof2qFPAvF3RRdOGkkQ+ vwng== X-Gm-Message-State: APjAAAXxpyHdMRJK7BLq5gzCkj2S7+SPIgJQeePokU0AtqfhmiIg7jTX P+A9EZvUW7XgwIc35k2QRfY= X-Google-Smtp-Source: APXvYqz1nX+bncZ8n9n5kj71bu8NqYiu74aROWJVE2AP9sdudntyLG0aOUzc9PGEiZmUEurdRpqvpQ== X-Received: by 2002:a1c:a503:: with SMTP id o3mr24745282wme.37.1563220394834; Mon, 15 Jul 2019 12:53:14 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:e1af:5c69:a16b:945c]) by smtp.gmail.com with ESMTPSA id t15sm16661622wrx.84.2019.07.15.12.53.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 15 Jul 2019 12:53:14 -0700 (PDT) From: Simon Goldschmidt To: Joe Hershberger Date: Mon, 15 Jul 2019 21:53:05 +0200 Message-Id: <20190715195305.6064-1-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] net: designware: use 'phy_connect' instead of open coded X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Using 'phy_connect' instead of 'phy_find_by_mask' and 'phy_connect_dev' both deduplicates code and adds support for 'fixed-link'. Signed-off-by: Simon Goldschmidt Acked-by: Joe Hershberger --- drivers/net/designware.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 2c5d9560c5..e08f459cf4 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -480,18 +480,16 @@ static int _dw_free_pkt(struct dw_eth_dev *priv) static int dw_phy_init(struct dw_eth_dev *priv, void *dev) { struct phy_device *phydev; - int mask = 0xffffffff, ret; + int phy_addr = -1, ret; #ifdef CONFIG_PHY_ADDR - mask = 1 << CONFIG_PHY_ADDR; + phy_addr = CONFIG_PHY_ADDR; #endif - phydev = phy_find_by_mask(priv->bus, mask, priv->interface); + phydev = phy_connect(priv->bus, phy_addr, dev, priv->interface); if (!phydev) return -ENODEV; - phy_connect_dev(phydev, dev); - phydev->supported &= PHY_GBIT_FEATURES; if (priv->max_speed) { ret = phy_set_supported(phydev, priv->max_speed);