From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752568AbcAPRLx (ORCPT ); Sat, 16 Jan 2016 12:11:53 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:58371 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752441AbcAPRLw (ORCPT ); Sat, 16 Jan 2016 12:11:52 -0500 Date: Sat, 16 Jan 2016 18:11:49 +0100 From: Andrew Lunn To: Teresa Remmet Cc: netdev@vger.kernel.org, Florian Fainelli , linux-kernel@vger.kernel.org, "David S. Miller" Subject: Re: [PATCH] net: phy: smsc: Fix disabling energy detect mode Message-ID: <20160116171149.GA9880@lunn.ch> References: <1452849633-26877-1-git-send-email-t.remmet@phytec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452849633-26877-1-git-send-email-t.remmet@phytec.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static void smsc_phy_remove(struct phy_device *phydev) > +{ > + struct device *dev = &phydev->mdio.dev; > + bool *priv = phydev->priv; > + > + if (priv) > + devm_kfree(dev, priv); > +} Not needed, since this is the devm_ API. >>From a stylistic point of view, it might be better to define a structure with a single member. It is what people expect a priv to be. It keeps the maintenance burden lower if you do things in the normal way. Andrew