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 DF6E1C4167B for ; Sun, 26 Nov 2023 18:15:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbjKZSO5 (ORCPT ); Sun, 26 Nov 2023 13:14:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKZSOz (ORCPT ); Sun, 26 Nov 2023 13:14:55 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C3EF7; Sun, 26 Nov 2023 10:15:02 -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=NDXLFxpUsTuPhTjVM1aK4p4em/oxzx34dIvrIxa7By0=; b=WpYks8pHGWIk3goxh312e99NVt 6NXlIT7FPT+EYS7EpPG1MAs73JgBWoIFmRuJcvswZDiMXeiFGFfYF6OkudHyjHX+sh05UAsyJ8use AkBWb60peZxJIbrmxZzVaylAfBSdfmxMuUKQCnOyEvPWJ70ZHqOAsfWVEJT43fnFibmE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r7Jee-001GPj-98; Sun, 26 Nov 2023 19:14:52 +0100 Date: Sun, 26 Nov 2023 19:14:52 +0100 From: Andrew Lunn To: Christian Marangi Cc: Florian Fainelli , Broadcom internal kernel review list , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , David Epping , Harini Katakam , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH 3/3] net: phy: add support for PHY package MMD read/write Message-ID: <4166bb2a-66ef-4757-b05b-7d5d7a415c67@lunn.ch> References: <20231126003748.9600-1-ansuelsmth@gmail.com> <20231126003748.9600-3-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231126003748.9600-3-ansuelsmth@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 26, 2023 at 01:37:48AM +0100, Christian Marangi wrote: > Some PHY in PHY package may require to read/write MMD regs to correctly > configure the PHY package. > > Add support for these additional required function in both lock and no > lock variant. You are assuming the PHY only supports C45 over C22. But what about those PHYs which have native C45? And maybe don't have C22 at all? You should refactor the code of __phy_read_mmd() into a helper and use it here. Andrew