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 D0FD715BD for ; Fri, 26 May 2023 18:20:23 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18B5DD3 for ; Fri, 26 May 2023 11:20:22 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id f7b7cffa-fbf1-11ed-a9de-005056bdf889; Fri, 26 May 2023 21:20:19 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Fri, 26 May 2023 21:20:17 +0300 To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , Jiawen Wu , Maxime Chevallier , Simon Horman , netdev@vger.kernel.org Subject: Re: [PATCH net-next 1/6] net: mdio: add mdio_device_get() and mdio_device_put() 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:24AM +0100, Russell King (Oracle) kirjoitti: > Add two new operations for a mdio device to manage the refcount on the > underlying struct device. This will be used by mdio PCS drivers to > simplify the creation and destruction handling, making it easier for > users to get it correct. ... > +static inline void mdio_device_get(struct mdio_device *mdiodev) > +{ > + get_device(&mdiodev->dev); Dunno what is the practice in net, but it makes sense to have the pattern as if (mdiodev) return to_mdiodev(get_device(&mdiodev->dev)); which might be helpful in some cases. This approach is used in many cases in the kernel. > +} P.S. Just my 2c, you may ignore the above comment. -- With Best Regards, Andy Shevchenko