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=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 7EAACC63777 for ; Tue, 17 Nov 2020 02:10:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3710424699 for ; Tue, 17 Nov 2020 02:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727662AbgKQCKF (ORCPT ); Mon, 16 Nov 2020 21:10:05 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:59206 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgKQCKE (ORCPT ); Mon, 16 Nov 2020 21:10:04 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1keqRQ-007SBo-IQ; Tue, 17 Nov 2020 03:09:56 +0100 Date: Tue, 17 Nov 2020 03:09:56 +0100 From: Andrew Lunn To: Sven Van Asbroeck Cc: Bryan Whitehead , David S Miller , Jakub Kicinski , 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: <20201117020956.GF1752213@lunn.ch> References: <20201116170155.26967-1-TheSven73@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116170155.26967-1-TheSven73@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Andrew