From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [Linaro-acpi] [RFC PATCH for Juno 1/2] net: smsc911x add support for probing from ACPI Date: Mon, 1 Sep 2014 17:53:33 +0100 Message-ID: <20140901165333.GE608@arm.com> References: <1409583961-7466-1-git-send-email-hanjun.guo@linaro.org> <1409583961-7466-2-git-send-email-hanjun.guo@linaro.org> <2861461.8zNpLC3I2n@wuerfel> <20140901152854.GJ2953@xora-haswell.xora.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from fw-tnat.austin.arm.com ([217.140.110.23]:14540 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751110AbaIAQxp (ORCPT ); Mon, 1 Sep 2014 12:53:45 -0400 Content-Disposition: inline In-Reply-To: <20140901152854.GJ2953@xora-haswell.xora.org.uk> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Graeme Gregory Cc: Arnd Bergmann , "linaro-acpi@lists.linaro.org" , Rob Herring , Randy Dunlap , Robert Richter , Jason Cooper , "linux-acpi@vger.kernel.org" , Marc Zyngier , Daniel Lezcano , "Rafael J. Wysocki" , Robert Moore , Will Deacon , "linux-kernel@vger.kernel.org" , Mark Brown , Olof Johansson , Liviu Dudau , Bjorn Helgaas , "linux-arm-kernel@lists.infradead.org" , Lv Zheng On Mon, Sep 01, 2014 at 04:28:54PM +0100, Graeme Gregory wrote: > On Mon, Sep 01, 2014 at 05:17:51PM +0200, Arnd Bergmann wrote: > > On Monday 01 September 2014 23:06:00 Hanjun Guo wrote: > > > +#ifdef CONFIG_ACPI > > > +/* Configure some sensible defaults for ACPI mode */ > > > +static int smsc911x_probe_config_acpi(struct smsc911x_platform_config *config, > > > + acpi_handle *ahandle) > > > +{ > > > + if (!ahandle) > > > + return -ENOSYS; > > > + > > > + config->phy_interface = PHY_INTERFACE_MODE_MII; > > > > > > > Please remove the #ifdef and use > > > > if (!IS_ENABLED(CONFIG_ACPI) || !ahandle) > > > > to check for ACPI support. This should result in the same object code > > in all cases, but give better compile-time coverage when ACPI is > > disabled. > > > struct acpi_handle does not exist in the case !CONFIG_ACPI Confused. Then how come smsc911x_drv_probe() has this line: acpi_handle *ahandle = ACPI_HANDLE(&pdev->dev); without any #ifdef's. -- Catalin