From patchwork Fri Apr 23 08:22:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 426273 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp1092437jao; Fri, 23 Apr 2021 01:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqjag6ywyDLaYNFBg7d6P0ht56f3ZxMAIgfSeblgHPajXrKDlAxAtYuiGRgZJztAHpJj2f X-Received: by 2002:a05:6a00:72b:b029:218:6603:a6a9 with SMTP id 11-20020a056a00072bb02902186603a6a9mr2588891pfm.78.1619166139974; Fri, 23 Apr 2021 01:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619166139; cv=none; d=google.com; s=arc-20160816; b=KB46KAEtbAEGuNjR6MvXBQm8OEayro1ZCAYYnQhHLU+tK/LnOCUpO7wZknmchm7EFD h/vCpXV0happ3Yn/w03J8f/1xmkptE/XA0IdaHR4M4Lh0SblRlkulbscJvARakhtbnAO tEcCPvp/2Nbmz53LPI7xtNAaeIJUUa5v9eY40q+6BKoQ8otg4xB2u3u5ybXRZpioTHgQ niFbHb/q5Z0gNkGj9iNWk5YTkdiFJJdfWsDfatR+kcv80ZN+CHtlbwVWsGy83cu81vGb 0T9nAjkzWuDSlgiViTGnzIt+Wq7xqdnDMStV/Ahh9xCAGfs6O3J30o/p/RSKtqlH3qDi WaYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MPPttOQ4y+lHOJw1rgFNqb/3DdTQmk+sv8Yecz46jBg=; b=bSOQ/qiPM+dsxpLvIjlEfqKRzZ75aimMmwhxWAZpOplfX+3u6mCWcalP+Nq8vBM7Tg 7DpwF2bRICjUpieorCyfcRCaBO2aZcx1NsqdYZOYFP69Tyb9J6jxA2lB5+1VinP0TDxv E5CNUlCnxBeC09535qFCGc1l/eimAhAZXGfdwKHBPPEPMr6knbBQWLvYFcQHnxrB6/86 A1sz1FIsJ6vDTojJqfd0qzqCY1vYcLDQcJlNhY0D0rM/gUHtYul0vx2UA8NfdNDfuUTs nTo7jrXphf7OYPwBNoA3vRb/vIa0OyK7Kspk9oBBSqUaxtmnkHkaE9W3403a/Ye3Jys9 xTqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nh0qFlJN; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si6066488pgr.135.2021.04.23.01.22.19; Fri, 23 Apr 2021 01:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nh0qFlJN; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241421AbhDWIWy (ORCPT + 8 others); Fri, 23 Apr 2021 04:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbhDWIWw (ORCPT ); Fri, 23 Apr 2021 04:22:52 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2220C061756 for ; Fri, 23 Apr 2021 01:22:15 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id a5so17879169ljk.0 for ; Fri, 23 Apr 2021 01:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MPPttOQ4y+lHOJw1rgFNqb/3DdTQmk+sv8Yecz46jBg=; b=nh0qFlJNsOOnu0zf+GVaL/eA3VBUitV0yswC8M5MACrAXAOtyyugGd9NBUKghUknnT oIff5VGMkQwNIkTIfkZbOnexfqAjfdDDps/f+tflAg1BNJGPk6aFsy8KSPMNpQqxMjKt 71OFy1UbdNOpQ9+AKI0pMY4A9KLNp7GYeeiPsuGeblXfnePkIcaQHT72MnarzgRq659D 5C6SbN49wsl0yrvPRlERsv6JNcl/PJTtaYmZrj+PxHR/TCT9Kk0miwn5+yJx3fBKxu1e FSUaYXvtpg5W8hzOezyEhT1F9VUIYVk0fGHOwaupvx3KBTTYXZP6h/yFpqEA9IOb8GpL hZkA== 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:mime-version:content-transfer-encoding; bh=MPPttOQ4y+lHOJw1rgFNqb/3DdTQmk+sv8Yecz46jBg=; b=nUZmEbWr2uC0eovvUi9TJ01fDGLPyMHzKyElhYZQ8qVhtKe2RplGC7p+je4n3W+7aQ IIYw/1ZNm3vYbwCJwSg3KrN8sXpqesgKZqnWOYA/4hWZtEieZ2b963FBWPrPMSg9KMgs /NHu7zVNFf6BdyOdi9HHqgdoygt8gXMtZhevwLvmwj5bGcv73MMAqahPnl8IwoN2Cu6L YmMXfAlshm8MgDcpZNzwA2zj2F2UFCJ6QkQvIiZLMRoBUGKuImnURt1IRGzO4/lv0Ipe hI94HQ5POy0c3EY8gsdui21P1NL13lFp0avYkhC3TCFDFtcKm2P0JUa58oNlS//0uvmq VbWw== X-Gm-Message-State: AOAM530cxNyNvMCWWu57XQLxkQpTZSXAbxEoz71bYOaz/qk031kRsbux BPu9U05Pw0RcgNNnnZ8A+yLKUBk2ULI11g== X-Received: by 2002:a05:651c:321:: with SMTP id b1mr2038443ljp.67.1619166133727; Fri, 23 Apr 2021 01:22:13 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id x74sm484475lff.145.2021.04.23.01.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Apr 2021 01:22:13 -0700 (PDT) From: Linus Walleij To: netdev@vger.kernel.org, "David S . Miller" Cc: Andrew Lunn , Heiner Kallweit , Russell King , Linus Walleij Subject: [PATCH 2/3 net-next v3] net: ethernet: ixp4xx: Retire ancient phy retrieveal Date: Fri, 23 Apr 2021 10:22:07 +0200 Message-Id: <20210423082208.2244803-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210423082208.2244803-1-linus.walleij@linaro.org> References: <20210423082208.2244803-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This driver was using a really dated way of obtaining the phy by printing a string and using it with phy_connect(). Switch to using more reasonable modern interfaces. Suggested-by: Andrew Lunn Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - New patch --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.29.2 Reviewed-by: Andrew Lunn diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c index 9defaa21a1a9..4df2686ac5b8 100644 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c @@ -1360,7 +1360,6 @@ static const struct net_device_ops ixp4xx_netdev_ops = { static int ixp4xx_eth_probe(struct platform_device *pdev) { - char phy_id[MII_BUS_ID_SIZE + 3]; struct phy_device *phydev = NULL; struct device *dev = &pdev->dev; struct eth_plat_info *plat; @@ -1462,14 +1461,15 @@ static int ixp4xx_eth_probe(struct platform_device *pdev) __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); udelay(50); - snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, - mdio_bus->id, plat->phy); - phydev = phy_connect(ndev, phy_id, &ixp4xx_adjust_link, - PHY_INTERFACE_MODE_MII); + phydev = mdiobus_get_phy(mdio_bus, plat->phy); if (IS_ERR(phydev)) { err = PTR_ERR(phydev); goto err_free_mem; } + err = phy_connect_direct(ndev, phydev, ixp4xx_adjust_link, + PHY_INTERFACE_MODE_MII); + if (err) + goto err_free_mem; phydev->irq = PHY_POLL;