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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BEE1C433F5 for ; Mon, 7 Mar 2022 13:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242526AbiCGNyW (ORCPT ); Mon, 7 Mar 2022 08:54:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242491AbiCGNyU (ORCPT ); Mon, 7 Mar 2022 08:54:20 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1661323BF7; Mon, 7 Mar 2022 05:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=n5uzR6SaDmZfOFP2LFe2YyC5cLyYwoZpNTwck49UQ74=; b=M2L4L23OoPXJQG8rmDHAznN/08 A6V/ZW676JXY+zcK2ils+9zO8KJ7XxtC7aAHCXb2VpE6crNB8J/oLcVZYWGluT5B2B0sL+Afmdfbc jNATaiW853qw6PqQI5sTxH25z6toVcCUgqT2VgV7UISG00ujfBg2XTZu/g7iOoqI71VY=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nRDne-009cPO-Pq; Mon, 07 Mar 2022 14:53:22 +0100 Date: Mon, 7 Mar 2022 14:53:22 +0100 From: Andrew Lunn To: Arun Ramadoss Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heiner Kallweit , Russell King , Jakub Kicinski , "David S . Miller" , UNGLinuxDriver@microchip.com Subject: Re: [RFC PATCH net-next 1/2] net: phy: exported the genphy_read_master_slave function Message-ID: References: <20220307101743.8567-1-arun.ramadoss@microchip.com> <20220307101743.8567-2-arun.ramadoss@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220307101743.8567-2-arun.ramadoss@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -2401,9 +2396,14 @@ int genphy_read_status(struct phy_device *phydev) > phydev->pause = 0; > phydev->asym_pause = 0; > > - err = genphy_read_master_slave(phydev); > - if (err < 0) > - return err; > + if (phydev->is_gigabit_capable) { > + err = genphy_read_master_slave(phydev); > + if (err < 0) > + return err; > + } else { > + phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED; > + phydev->master_slave_state = MASTER_SLAVE_STATE_UNSUPPORTED; > + } Rather than have this else clause, just initialize them to _UNSUPPORTED, in the same block as speed, duplex and pause are initialized above. Otherwise, this looks good. Andrew