Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1311002

Re: [PATCH] net: phy: smsc: Fix disabling energy detect mode

From Andrew Lunn <andrew@lunn.ch>
Newsgroups linux.kernel
Subject Re: [PATCH] net: phy: smsc: Fix disabling energy detect mode
Date 2016-01-16 18:20 +0100
Message-ID <qRCG6-7ja-13@gated-at.bofh.it> (permalink)
References <qR8RI-464-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> +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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] net: phy: smsc: Fix disabling energy detect mode Andrew Lunn <andrew@lunn.ch> - 2016-01-16 18:20 +0100

csiph-web