From patchwork Fri May 8 12:32:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 535A4C38A2A for ; Fri, 8 May 2020 12:42:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C4FE24971 for ; Fri, 8 May 2020 12:42:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941750; bh=ZQKEIAGLe2s9mWOHVz6Ecs4t1Uznlxw/Mut7HicAnzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t0IB3/i9IbQ9TffDi3B1NVt0OM8jKfIAVMU24uOLfenw7eLO20CbqVfiiLhfQcK08 NmrbBFQmJRSL9S6FUl6bGCaMnjjMXNSR6bHFpZ+aO8DGAgHiVUiusWfWCcXHEVk3sI RnK9HF+mVOzPZD+TEcHhzznYbOucTm3y0+M4ZR3Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbgEHMm2 (ORCPT ); Fri, 8 May 2020 08:42:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:39432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728138AbgEHMm1 (ORCPT ); Fri, 8 May 2020 08:42:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 D065221835; Fri, 8 May 2020 12:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588941746; bh=ZQKEIAGLe2s9mWOHVz6Ecs4t1Uznlxw/Mut7HicAnzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1SnFHuOfikMkyBtoLZ8/NsUztu07fxF1iSl80cxeJsWF+sn3Ohfy47ursDsRcmD4S T8FE3OUqubvf2tg4uxULBTvidXdHsFsFlRGp65ydWRcjvbFTfpBTbiWiJ45/Ig2b3T J5Uq1vs5oLL4lHmL/E6r611zNPs4Tp46KE2c4Rf8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Henri Roosen , "David S. Miller" Subject: [PATCH 4.4 156/312] phy: micrel: Fix finding PHY properties in MAC node for KSZ9031. Date: Fri, 8 May 2020 14:32:27 +0200 Message-Id: <20200508123135.430852212@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200508123124.574959822@linuxfoundation.org> References: <20200508123124.574959822@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Roosen Henri commit b4c19f71252e3b6b8c6478fd712c592f00b11438 upstream. Commit 651df2183543 ("phy: micrel: Fix finding PHY properties in MAC node.") only fixes finding PHY properties in MAC node for KSZ9021. This commit applies the same fix for KSZ9031. Fixes: 8b63ec1837fa ("phylib: Make PHYs children of their MDIO bus, not the bus' parent.") Acked-by: Andrew Lunn Signed-off-by: Henri Roosen Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/micrel.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -482,9 +482,17 @@ static int ksz9031_config_init(struct ph "txd2-skew-ps", "txd3-skew-ps" }; static const char *control_skews[2] = {"txen-skew-ps", "rxdv-skew-ps"}; + const struct device *dev_walker; - if (!of_node && dev->parent->of_node) - of_node = dev->parent->of_node; + /* The Micrel driver has a deprecated option to place phy OF + * properties in the MAC node. Walk up the tree of devices to + * find a device with an OF node. + */ + dev_walker = &phydev->dev; + do { + of_node = dev_walker->of_node; + dev_walker = dev_walker->parent; + } while (!of_node && dev_walker); if (of_node) { ksz9031_of_load_skew_values(phydev, of_node,