public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Len Brown <lenb@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>
Subject: [PATCH 1/4] ACPI: add drivers_autoprobe in struct acpi_device
Date: Wed,  3 Oct 2012 16:00:11 -0700	[thread overview]
Message-ID: <1349305214-3241-2-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <1349305214-3241-1-git-send-email-yinghai@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 <yinghai@kernel.org>
---
 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)
-- 
1.7.7


  reply	other threads:[~2012-10-03 23:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAE9FiQWgvVqnTTeYFvxf1GxLcEEeRyN-uSKPdg3o69oCpm43sQ@mail.gmail.com>
2012-10-03 23:00 ` [PATCH 0/4] ACPI: kill acpi_pci_root_start Yinghai Lu
2012-10-03 23:00   ` Yinghai Lu [this message]
2012-10-04 13:03     ` [PATCH 1/4] ACPI: add drivers_autoprobe in struct acpi_device Konrad Rzeszutek Wilk
2012-10-04 15:15       ` Yinghai Lu
2012-10-09 16:38         ` Konrad Rzeszutek Wilk
2012-10-03 23:00   ` [PATCH 2/4] ACPI: use device drivers_autoprobe to delay loading acpi drivers Yinghai Lu
2012-10-03 23:00   ` [PATCH 3/4] PCI, ACPI: Remove not used acpi_pci_root_start() Yinghai Lu
2012-10-03 23:00   ` [PATCH 4/4] ACPI: remove acpi_op_start workaround Yinghai Lu
2012-10-04 12:57     ` Konrad Rzeszutek Wilk
2012-10-04 17:47   ` [PATCH 0/4] ACPI: kill acpi_pci_root_start Bjorn Helgaas
2012-10-04 18:36     ` Yinghai Lu
2012-10-04 19:44       ` Bjorn Helgaas
2012-10-04 19:54         ` Rafael J. Wysocki
2012-10-04 20:14         ` Yinghai Lu
2012-10-04 20:47           ` Bjorn Helgaas
2012-10-04 19:53     ` Rafael J. Wysocki
2012-10-04 21:23   ` Rafael J. Wysocki
2012-10-04 21:31     ` Yinghai Lu
2012-10-04 21:53       ` Rafael J. Wysocki
2012-10-04 22:01         ` Yinghai Lu
2012-10-04 22:36           ` Rafael J. Wysocki
2012-10-04 22:46             ` Yinghai Lu
2012-10-05 23:01               ` Rafael J. Wysocki
2012-10-05 23:10                 ` Yinghai Lu
2012-10-08 20:12                   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349305214-3241-2-git-send-email-yinghai@kernel.org \
    --to=yinghai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox