From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C1015C2D0E4 for ; Tue, 17 Nov 2020 18:48:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5736E2417E for ; Tue, 17 Nov 2020 18:48:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="A/Q5vri9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729718AbgKQSr7 (ORCPT ); Tue, 17 Nov 2020 13:47:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:43800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbgKQSr6 (ORCPT ); Tue, 17 Nov 2020 13:47:58 -0500 Received: from kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net (c-67-180-217-166.hsd1.ca.comcast.net [67.180.217.166]) (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 C86BA238E6; Tue, 17 Nov 2020 18:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605638878; bh=0VPlLayVfnfP0kTDkgW/nx8/bnKhdiVjBpAwu/nEopc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=A/Q5vri9xkq2Bn9JVhWHfott0RbPFvzFKSPZRgfZeVvCGwjjha2etXI6WqikvM7Zc PTrigx6P1WYm3gskVDaNr7DZYurqHWsqccgrVlVbXtnFzr8awtSd17ITtD/q/B283T 85a8uKDGHaH1LI755RhU6gkAqqHElLypnsHSrxDk= Date: Tue, 17 Nov 2020 10:47:56 -0800 From: Jakub Kicinski To: Andrew Lunn Cc: Sven Van Asbroeck , Bryan Whitehead , David S Miller , Microchip Linux Driver Support , Roelof Berg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v1] lan743x: replace devicetree phy parse code with library function Message-ID: <20201117104756.766b5953@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> In-Reply-To: <20201117020956.GF1752213@lunn.ch> References: <20201116170155.26967-1-TheSven73@gmail.com> <20201117020956.GF1752213@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Nov 2020 03:09:56 +0100 Andrew Lunn wrote: > On Mon, Nov 16, 2020 at 12:01:55PM -0500, Sven Van Asbroeck wrote: > > From: Sven Van Asbroeck > > > > The code in this driver which parses the devicetree to determine > > the phy/fixed link setup, can be replaced by a single library > > function: of_phy_get_and_connect(). > > > > Behaviour is identical, except that the library function will > > complain when 'phy-connection-type' is omitted, instead of > > blindly using PHY_INTERFACE_MODE_NA, which would result in an > > invalid phy configuration. > > > > The library function no longer brings out the exact phy_mode, > > but the driver doesn't need this, because phy_interface_is_rgmii() > > queries the phydev directly. Remove 'phy_mode' from the private > > adapter struct. > > > > While we're here, log info about the attached phy on connect, > > this is useful because the phy type and connection method is now > > fully configurable via the devicetree. > > > > Tested on a lan7430 chip with built-in phy. Verified that adding > > fixed-link/phy-connection-type in the devicetree results in a > > fixed-link setup. Used ethtool to verify that the devicetree > > settings are used. > > > > Tested-by: Sven Van Asbroeck # lan7430 > > Signed-off-by: Sven Van Asbroeck > > Reviewed-by: Andrew Lunn Applied, thanks!