From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B45815BD for ; Fri, 26 May 2023 18:23:03 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E64AFD3 for ; Fri, 26 May 2023 11:23:01 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 577a6faa-fbf2-11ed-abf4-005056bdd08f; Fri, 26 May 2023 21:22:59 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Fri, 26 May 2023 21:22:58 +0300 To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , Jiawen Wu , Maxime Chevallier , Simon Horman , Ioana Ciornei , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: Re: [PATCH net-next 4/6] net: pcs: lynx: add lynx_pcs_create_mdiodev() Message-ID: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Fri, May 26, 2023 at 11:14:39AM +0100, Russell King (Oracle) kirjoitti: > Add lynx_pcs_create_mdiodev() to simplify the creation of the mdio > device associated with lynx PCS. In order to allow lynx_pcs_destroy() > to clean this up, we need to arrange for lynx_pcs_create() to take a > refcount on the mdiodev, and lynx_pcs_destroy() to put it. > > Adding the refcounting to lynx_pcs_create()..lynx_pcs_destroy() will > be transparent to existing users of these interfaces. ... > + mdio_device_get(mdio); > lynx->mdio = mdio; Just for the sake of example of how it can be used (taking into account my previous comment): lynx->mdio = mdio_device_get(mdio); -- With Best Regards, Andy Shevchenko