From patchwork Fri Jan 11 20:31:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 1967361 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AD05140232 for ; Fri, 11 Jan 2013 20:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755345Ab3AKUZ6 (ORCPT ); Fri, 11 Jan 2013 15:25:58 -0500 Received: from hydra.sisk.pl ([212.160.235.94]:38068 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755341Ab3AKUZ6 (ORCPT ); Fri, 11 Jan 2013 15:25:58 -0500 Received: from vostro.rjw.lan (blf249.neoplus.adsl.tpnet.pl [83.28.199.249]) by hydra.sisk.pl (Postfix) with ESMTPSA id ED35CE5388; Fri, 11 Jan 2013 21:26:37 +0100 (CET) From: "Rafael J. Wysocki" To: Mika Westerberg Cc: ACPI Devel Maling List , Toshi Kani , Bjorn Helgaas , LKML , linux-pci@vger.kernel.org, Yinghai Lu , Myron Stowe , Yijing Wang , Jiang Liu Subject: Re: [PATCH 1/16] ACPI: Separate adding ACPI device objects from probing ACPI drivers Date: Fri, 11 Jan 2013 21:31:43 +0100 Message-ID: <2859994.arbXorpfaz@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.8.0-rc3+; KDE/4.9.5; x86_64; ; ) In-Reply-To: <20130111200046.GB13897@intel.com> References: <8498184.VilrUmatxI@vostro.rjw.lan> <23002897.6xbQGtPaGy@vostro.rjw.lan> <20130111200046.GB13897@intel.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Friday, January 11, 2013 10:00:46 PM Mika Westerberg wrote: > (Sorry to jump in late but I noticed one problem with this series while > testing). > > On Thu, Dec 20, 2012 at 02:47:47AM +0100, Rafael J. Wysocki wrote: > > +static acpi_status acpi_bus_probe_start(acpi_handle handle, u32 lvl, > > + void *context, void **not_used) > > +{ > > + struct acpi_bus_ops *ops = context; > > + acpi_status status = AE_OK; > > + struct acpi_device *device; > > + unsigned long long sta_not_used; > > + int type_not_used; > > + > > + /* > > + * Ignore errors ignored by acpi_bus_check_add() to avoid terminating > > + * namespace walks prematurely. > > + */ > > + if (acpi_bus_type_and_status(handle, &type_not_used, &sta_not_used)) > > + return AE_OK; > > + > > + if (acpi_bus_get_device(handle, &device)) > > + return AE_CTRL_DEPTH; > > + > > + if (ops->acpi_op_add) { > > + if (!acpi_match_device_ids(device, acpi_platform_device_ids)) { > > + /* This is a known good platform device. */ > > + acpi_create_platform_device(device); > > + } else if (device_attach(&device->dev)) { > > device_attach() returns 1 if it succeeds to attach device to a driver. In > that case we should continue and not return AE_CTRL_DEPTH, right? That's correct. The check is reversed, so we need the appended patch on top of linux-pm.git/acpi-scan. Thanks, Rafael --- From: Rafael J. Wysocki Subject: ACPI / scan: Fix check of device_attach() return value. Since device_attach() returns 1 on success and 0 on failure, the check against its return value in acpi_bus_device_attach() should be reveresed. Make it so. Reported-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -1598,7 +1598,7 @@ static acpi_status acpi_bus_device_attac if (!acpi_match_device_ids(device, acpi_platform_device_ids)) { /* This is a known good platform device. */ acpi_create_platform_device(device); - } else if (device_attach(&device->dev)) { + } else if (!device_attach(&device->dev)) { status = AE_CTRL_DEPTH; } return status;