Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3746422ybh; Tue, 6 Aug 2019 00:36:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2xEeZx/rXiIuTQ9Poc43c5nk6Ux26Vd9dc6OjpR+bhZqZhwv0JU2FJByoDFvtV3hllLf6 X-Received: by 2002:a17:902:bcc4:: with SMTP id o4mr1801004pls.90.1565077002847; Tue, 06 Aug 2019 00:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565077002; cv=none; d=google.com; s=arc-20160816; b=E/KqS3Tig5mlKGJClb2i2CwZ+PhVeZqrk4KLNRN1FjDep4udlVAXgiQQc0zOEvuDyO 0biEfoQuTTv014wdKoD/A00WNoxaR/Ui4+IILIgQp1zhUOtJLF7K8h7MwMM/hKyEON9Z NWKohC/lzCea6jc/fXU7Rbk1FZ/lP9/oCbZmFC5+vBuk4WBfHP6zOuiVXMPNRlBaE3xx dZQr6a2+ckPuyrkPpU/eG97MAXmUGyz7KmMEx9jLKhcI/9imbr0qVH73a0Fr2X1ulCqw yrSX5q223MZD+qF9asNiLeHXLphH8sOrMYlRO531OhnOnqPfP2TCbtIjHSJB3jVcHcLB Pv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Upn0KQWEWOGaCu0Bp6Ml/oD3L0+G1kTbIRrX6VFaboM=; b=XxJxQqLnSI7GR4bxKIjmlL+JTYH5W2+aLpeVfe7iXR9mqLzWCNJyrpcZ+zQDQpC9us 6Md1BiK65QFWkofiYH7x0xE164vrVuvts0DcXV9neHcz2ZPYA4y8Fynn44ULnaOmRLzU 6V8L2iKR0OyArOpieK+wHSRDy17UVNqLK8XLkn5i5eKpGcpKCMdpBxM57n0fYyeLYMHA GeO72wjxlwDwMqujsqvAxpNnz8aZKFQK5c8brySgE3m94/vfDqKwY9gwznfHt6kjmk1f v4rGOSY0u2S7FgEplwRwdXkX0Q5n8mJkEInAu1LLxNxUwxKfXE+LrGPJR5nI3UmHRf3N asHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ot83vAf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si46347706pgw.81.2019.08.06.00.36.26; Tue, 06 Aug 2019 00:36:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ot83vAf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732034AbfHFHfu (ORCPT + 99 others); Tue, 6 Aug 2019 03:35:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:42290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728798AbfHFHfu (ORCPT ); Tue, 6 Aug 2019 03:35:50 -0400 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2728A2189F; Tue, 6 Aug 2019 07:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565076949; bh=fZBRJKmjxvcp/mQzzUacJDHRPt54CTE5Q/sgx3Ed5sE=; h=From:To:Cc:Subject:Date:From; b=ot83vAf2vvFym5JdA92jT4XYOtvT3mNdwKTE4UHLl+TBHcisvQfnag0/rr1tjZmSr fcHLl5FoV8+r7lDIFeOhmJq791dM697zoERPimM4agMxjV1/RnQM7rWbfjTN5Ctiyk 0AMAtFqd2tla77qIXU0E+tTpNfSjicIZsRRKtLfA= Received: by wens.tw (Postfix, from userid 1000) id 5FACD5FC97; Tue, 6 Aug 2019 15:35:46 +0800 (CST) From: Chen-Yu Tsai To: "David S. Miller" , Maxime Ripard Cc: Chen-Yu Tsai , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net] net: ethernet: sun4i-emac: Support phy-handle property for finding PHYs Date: Tue, 6 Aug 2019 15:35:39 +0800 Message-Id: <20190806073539.32519-1-wens@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai The sun4i-emac uses the "phy" property to find the PHY it's supposed to use. This property was deprecated in favor of "phy-handle" in commit 8c5b09447625 ("dt-bindings: net: sun4i-emac: Convert the binding to a schemas"). Add support for this new property name, and fall back to the old one in case the device tree hasn't been updated. Signed-off-by: Chen-Yu Tsai --- The aforementioned commit is in v5.3-rc1. It would be nice to have the driver fix in the same release. In addition, an update for the device tree has been queued up for v5.4, which made us realize the driver needs an update. --- drivers/net/ethernet/allwinner/sun4i-emac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 3434730a7699..0537df06a9b5 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -860,7 +860,9 @@ static int emac_probe(struct platform_device *pdev) goto out_clk_disable_unprepare; } - db->phy_node = of_parse_phandle(np, "phy", 0); + db->phy_node = of_parse_phandle(np, "phy-handle", 0); + if (!db->phy_node) + db->phy_node = of_parse_phandle(np, "phy", 0); if (!db->phy_node) { dev_err(&pdev->dev, "no associated PHY\n"); ret = -ENODEV; -- 2.20.1