From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760029AbdAJInd (ORCPT ); Tue, 10 Jan 2017 03:43:33 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33608 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758978AbdAJIna (ORCPT ); Tue, 10 Jan 2017 03:43:30 -0500 Date: Tue, 10 Jan 2017 09:43:27 +0100 From: Johan Hovold To: Timur Tabi Cc: Johan Hovold , "David S. Miller" , Florian Fainelli , Madalin Bucur , Andrew Lunn , Vivien Didelot , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks Message-ID: <20170110084327.GA3501@localhost> References: <1480011691-13278-1-git-send-email-johan@kernel.org> <1480011691-13278-6-git-send-email-johan@kernel.org> <650c00e9-cf02-1764-5065-86f6c06817f3@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <650c00e9-cf02-1764-5065-86f6c06817f3@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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