From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mika Westerberg Subject: Re: [RFC PATCH 1/2] ACPI / PNP: Don't add "enumeration_by_parent" devices Date: Fri, 20 Apr 2018 16:52:22 +0300 Message-ID: <20180420135222.GY2173@lahna.fi.intel.com> References: <1524218846-169934-1-git-send-email-john.garry@huawei.com> <1524218846-169934-2-git-send-email-john.garry@huawei.com> <20180420130727.GV2173@lahna.fi.intel.com> <27c3f84e-4d53-4b6b-7382-04908082ed01@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <27c3f84e-4d53-4b6b-7382-04908082ed01@huawei.com> Sender: linux-kernel-owner@vger.kernel.org To: John Garry Cc: rjw@rjwysocki.net, andriy.shevchenko@linux.intel.com, linux-acpi@vger.kernel.org, lenb@kernel.org, lorenzo.pieralisi@arm.com, linux-kernel@vger.kernel.org, arnd@arndb.de, graeme.gregory@linaro.org, helgaas@kernel.org, linuxarm@huawei.com, z.liuxinliang@hisilicon.com List-Id: linux-acpi@vger.kernel.org On Fri, Apr 20, 2018 at 02:24:18PM +0100, John Garry wrote: > Hi Mika, > > On 20/04/2018 14:07, Mika Westerberg wrote: > > On Fri, Apr 20, 2018 at 06:07:25PM +0800, John Garry wrote: > > > + } else { > > > + device->driver_data = dev; > > > > I think this deserves a comment explaining why we (ab)use driver_data > > like this. > > Sure, could add. I didn't see any other way for the acpi_device structure to > reference the derived PNP device. > > TBH, This overall approach is not good since we are creating the PNP device > in the scan, and then leaving the device in limbo, waiting for the parent to > add it, if at all. There's no rule for this. > > So I'm looking for ideas on how to improve this. One idea is to make pnpacpi_add_device() available outside of PNP and call it directly (or some variation) in hisi_lpc.c when it walks over its children.