[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170110084327.GA3501@localhost>
Date: Tue, 10 Jan 2017 09:43:27 +0100
From: Johan Hovold <johan@...nel.org>
To: Timur Tabi <timur@...eaurora.org>
Cc: Johan Hovold <johan@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Madalin Bucur <madalin.bucur@....com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks
On Mon, Jan 09, 2017 at 01:49:53PM -0600, Timur Tabi wrote:
> On 11/24/2016 12:21 PM, Johan Hovold wrote:
> > + if (!has_acpi_companion(&pdev->dev))
> > + put_device(&adpt->phydev->mdio.dev);
>
> I was wondering if, instead of calling put_device() only on non-ACPI systems,
> would it be better if on an ACPI system I called get_device() manually? That
> is, some thing like this:
>
> int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt)
> {
> ...
> if (has_acpi_companion(&pdev->dev)) {
> ...
> get_device(&mii_bus->dev);
> } else {
> ...
Yeah, that's better.
Thanks,
Johan
Powered by blists - more mailing lists