diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-12 17:45:04 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-12 17:45:04 -0500 |
commit | 25d412d932fb3289ae5b510845d523330b80bb71 (patch) | |
tree | 7234bf9bf03af4b0f1f40830169cd7219ef586ed /drivers/base | |
parent | 98feb7cc61c50fe0fa36eeb994d5db527ca9e103 (diff) | |
parent | c713cd7f2d799c50a0721bf51d178ea9567215dd (diff) |
Merge branch 'acpi-hotplug'
* acpi-hotplug:
ACPI / scan: ACPI device object sysfs attribute for _STA evaluation
ACPI / hotplug / driver core: Handle containers in a special way
ACPI / hotplug: Add demand_offline hotplug profile flag
ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c
ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one()
ACPI / bind: Rework struct acpi_bus_type
ACPI / bind: Redefine acpi_preset_companion()
ACPI / bind: Redefine acpi_get_child()
PCI / ACPI: Use acpi_find_child_device() for child devices lookup
ACPI / bind: Simplify child device lookups
ACPI / scan: Use direct recurrence for device hierarchy walks
ACPI: Introduce acpi_set_device_status()
ACPI / hotplug: Drop unfinished global notification handling routines
ACPI / hotplug: Rework generic code to handle suprise removals
ACPI / hotplug: Move container-specific code out of the core
ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code
ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug()
ACPI / hotplug: Do not fail bus and device checks for disabled hotplug
ACPI / scan: Add acpi_device objects for all device nodes in the namespace
ACPI / scan: Define non-empty device removal handler
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/Makefile | 2 | ||||
-rw-r--r-- | drivers/base/base.h | 1 | ||||
-rw-r--r-- | drivers/base/container.c | 44 | ||||
-rw-r--r-- | drivers/base/init.c | 1 |
4 files changed, 47 insertions, 1 deletions
diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 94e8a80e87f8..d08c9d3b1d37 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile | |||
@@ -4,7 +4,7 @@ obj-y := core.o bus.o dd.o syscore.o \ | |||
4 | driver.o class.o platform.o \ | 4 | driver.o class.o platform.o \ |
5 | cpu.o firmware.o init.o map.o devres.o \ | 5 | cpu.o firmware.o init.o map.o devres.o \ |
6 | attribute_container.o transport_class.o \ | 6 | attribute_container.o transport_class.o \ |
7 | topology.o | 7 | topology.o container.o |
8 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o | 8 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o |
9 | obj-$(CONFIG_DMA_CMA) += dma-contiguous.o | 9 | obj-$(CONFIG_DMA_CMA) += dma-contiguous.o |
10 | obj-y += power/ | 10 | obj-y += power/ |
diff --git a/drivers/base/base.h b/drivers/base/base.h index 2cbc6774f4cd..24f424249d9b 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -100,6 +100,7 @@ static inline int hypervisor_init(void) { return 0; } | |||
100 | #endif | 100 | #endif |
101 | extern int platform_bus_init(void); | 101 | extern int platform_bus_init(void); |
102 | extern void cpu_dev_init(void); | 102 | extern void cpu_dev_init(void); |
103 | extern void container_dev_init(void); | ||
103 | 104 | ||
104 | struct kobject *virtual_device_parent(struct device *dev); | 105 | struct kobject *virtual_device_parent(struct device *dev); |
105 | 106 | ||
diff --git a/drivers/base/container.c b/drivers/base/container.c new file mode 100644 index 000000000000..ecbfbe2e908f --- /dev/null +++ b/drivers/base/container.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * System bus type for containers. | ||
3 | * | ||
4 | * Copyright (C) 2013, Intel Corporation | ||
5 | * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/container.h> | ||
13 | |||
14 | #include "base.h" | ||
15 | |||
16 | #define CONTAINER_BUS_NAME "container" | ||
17 | |||
18 | static int trivial_online(struct device *dev) | ||
19 | { | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | static int container_offline(struct device *dev) | ||
24 | { | ||
25 | struct container_dev *cdev = to_container_dev(dev); | ||
26 | |||
27 | return cdev->offline ? cdev->offline(cdev) : 0; | ||
28 | } | ||
29 | |||
30 | struct bus_type container_subsys = { | ||
31 | .name = CONTAINER_BUS_NAME, | ||
32 | .dev_name = CONTAINER_BUS_NAME, | ||
33 | .online = trivial_online, | ||
34 | .offline = container_offline, | ||
35 | }; | ||
36 | |||
37 | void __init container_dev_init(void) | ||
38 | { | ||
39 | int ret; | ||
40 | |||
41 | ret = subsys_system_register(&container_subsys, NULL); | ||
42 | if (ret) | ||
43 | pr_err("%s() failed: %d\n", __func__, ret); | ||
44 | } | ||
diff --git a/drivers/base/init.c b/drivers/base/init.c index c16f0b808a17..da033d3bab3c 100644 --- a/drivers/base/init.c +++ b/drivers/base/init.c | |||
@@ -33,4 +33,5 @@ void __init driver_init(void) | |||
33 | platform_bus_init(); | 33 | platform_bus_init(); |
34 | cpu_dev_init(); | 34 | cpu_dev_init(); |
35 | memory_dev_init(); | 35 | memory_dev_init(); |
36 | container_dev_init(); | ||
36 | } | 37 | } |