From patchwork Wed Oct 3 23:00:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 1543601 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 2347340AC9 for ; Wed, 3 Oct 2012 23:00:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932383Ab2JCXA3 (ORCPT ); Wed, 3 Oct 2012 19:00:29 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:31193 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932111Ab2JCXAZ (ORCPT ); Wed, 3 Oct 2012 19:00:25 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q93N0Ljj031163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Oct 2012 23:00:21 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q93N0K9E016207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Oct 2012 23:00:21 GMT Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q93N0KNt021513; Wed, 3 Oct 2012 18:00:20 -0500 Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 03 Oct 2012 16:00:20 -0700 From: Yinghai Lu To: Len Brown , Bjorn Helgaas , Greg Kroah-Hartman Cc: Andrew Morton , Linus Torvalds , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Yinghai Lu Subject: [PATCH 1/4] ACPI: add drivers_autoprobe in struct acpi_device Date: Wed, 3 Oct 2012 16:00:11 -0700 Message-Id: <1349305214-3241-2-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1349305214-3241-1-git-send-email-yinghai@kernel.org> References: <1349305214-3241-1-git-send-email-yinghai@kernel.org> X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org To use to control the delay attach driver for acpi_device. Will use bus notifier to toggle this bits when needed. Signed-off-by: Yinghai Lu --- drivers/acpi/scan.c | 8 +++++++- include/acpi/acpi_bus.h | 1 + 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index d1ecca2..cbb3ed1 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -333,7 +333,12 @@ static void acpi_device_release(struct device *dev) static int acpi_bus_match(struct device *dev, struct device_driver *drv) { struct acpi_device *acpi_dev = to_acpi_device(dev); - struct acpi_driver *acpi_drv = to_acpi_driver(drv); + struct acpi_driver *acpi_drv; + + if (!acpi_dev->drivers_autoprobe) + return 0; + + acpi_drv = to_acpi_driver(drv); return !acpi_match_device_ids(acpi_dev, acpi_drv->ids); } @@ -1268,6 +1273,7 @@ static int acpi_add_single_object(struct acpi_device **child, device->parent = acpi_bus_get_parent(handle); device->bus_ops = *ops; /* workround for not call .start */ STRUCT_TO_INT(device->status) = sta; + device->drivers_autoprobe = true; acpi_device_get_busid(device); diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index bde976e..969544e 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -304,6 +304,7 @@ struct acpi_device { struct device dev; struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ + bool drivers_autoprobe; }; static inline void *acpi_driver_data(struct acpi_device *d)