From patchwork Tue Oct 2 06:32:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 1535721 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0DB11DF238 for ; Tue, 2 Oct 2012 06:33:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404Ab2JBGdL (ORCPT ); Tue, 2 Oct 2012 02:33:11 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:31262 "EHLO acsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912Ab2JBGdJ (ORCPT ); Tue, 2 Oct 2012 02:33:09 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q926X46R012985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 2 Oct 2012 06:33:05 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q926X3Vg022968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Oct 2012 06:33:04 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q926X3Cm001260; Tue, 2 Oct 2012 01:33:03 -0500 Received: from linux-siqj.site (/75.36.244.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Oct 2012 23:33:02 -0700 From: Yinghai Lu To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Yinghai Lu , Greg Kroah-Hartman Subject: [PATCH 01/10] device: add drivers_autoprobe in struct device Date: Mon, 1 Oct 2012 23:32:59 -0700 Message-Id: <1349159588-15029-2-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1349159588-15029-1-git-send-email-yinghai@kernel.org> References: <1349159588-15029-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] 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 specific device. Will use bus notifier to toggle this bits when needed. Signed-off-by: Yinghai Lu Cc: Greg Kroah-Hartman --- drivers/base/bus.c | 2 +- drivers/base/core.c | 1 + include/linux/device.h | 1 + 3 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 181ed26..22b826a 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -538,7 +538,7 @@ void bus_probe_device(struct device *dev) if (!bus) return; - if (bus->p->drivers_autoprobe) { + if (bus->p->drivers_autoprobe && dev->drivers_autoprobe) { ret = device_attach(dev); WARN_ON(ret < 0); } diff --git a/drivers/base/core.c b/drivers/base/core.c index 5e6e00b..8a71f88 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -656,6 +656,7 @@ void device_initialize(struct device *dev) INIT_LIST_HEAD(&dev->devres_head); device_pm_init(dev); set_dev_node(dev, -1); + dev->drivers_autoprobe = true; } static struct kobject *virtual_device_parent(struct device *dev) diff --git a/include/linux/device.h b/include/linux/device.h index 52a5f15..e08db26 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -647,6 +647,7 @@ struct device { struct bus_type *bus; /* type of bus device is on */ struct device_driver *driver; /* which driver has allocated this device */ + bool drivers_autoprobe; void *platform_data; /* Platform specific data, device core doesn't touch it */ struct dev_pm_info power;