diff options
author | Yinghai Lu <yinghai@kernel.org> | 2013-01-21 16:20:47 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-25 16:43:22 -0500 |
commit | 92d8aff3a317fcd6f78ed9ac13dbbaeae8cb11ed (patch) | |
tree | d55492edb9abed37b88b25be4fef30a840d0200a | |
parent | e723f0b4f4ecaf3fdd542124b3f99379ab8df757 (diff) |
PCI/ACPI: acpiphp: Rename alloc_acpiphp_hp_work() to alloc_acpi_hp_work()
Will need to use it for PCI root bridge hotplug support, so rename
*acpiphp* to *acpi* and move to osc.c. Also make kacpi_hotplug_wq static
after that.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi@vger.kernel.org
-rw-r--r-- | drivers/acpi/osl.c | 24 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 42 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 9 | ||||
-rw-r--r-- | include/acpi/acpiosxf.h | 2 |
4 files changed, 37 insertions, 40 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 3ff267861541..59ec5f52e849 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -84,8 +84,7 @@ static acpi_osd_handler acpi_irq_handler; | |||
84 | static void *acpi_irq_context; | 84 | static void *acpi_irq_context; |
85 | static struct workqueue_struct *kacpid_wq; | 85 | static struct workqueue_struct *kacpid_wq; |
86 | static struct workqueue_struct *kacpi_notify_wq; | 86 | static struct workqueue_struct *kacpi_notify_wq; |
87 | struct workqueue_struct *kacpi_hotplug_wq; | 87 | static struct workqueue_struct *kacpi_hotplug_wq; |
88 | EXPORT_SYMBOL(kacpi_hotplug_wq); | ||
89 | 88 | ||
90 | /* | 89 | /* |
91 | * This list of permanent mappings is for memory that may be accessed from | 90 | * This list of permanent mappings is for memory that may be accessed from |
@@ -1778,3 +1777,24 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state, | |||
1778 | { | 1777 | { |
1779 | __acpi_os_prepare_sleep = func; | 1778 | __acpi_os_prepare_sleep = func; |
1780 | } | 1779 | } |
1780 | |||
1781 | void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context, | ||
1782 | void (*func)(struct work_struct *work)) | ||
1783 | { | ||
1784 | struct acpi_hp_work *hp_work; | ||
1785 | int ret; | ||
1786 | |||
1787 | hp_work = kmalloc(sizeof(*hp_work), GFP_KERNEL); | ||
1788 | if (!hp_work) | ||
1789 | return; | ||
1790 | |||
1791 | hp_work->handle = handle; | ||
1792 | hp_work->type = type; | ||
1793 | hp_work->context = context; | ||
1794 | |||
1795 | INIT_WORK(&hp_work->work, func); | ||
1796 | ret = queue_work(kacpi_hotplug_wq, &hp_work->work); | ||
1797 | if (!ret) | ||
1798 | kfree(hp_work); | ||
1799 | } | ||
1800 | EXPORT_SYMBOL_GPL(alloc_acpi_hp_work); | ||
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index b94879d20630..bf338d2ff371 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -1203,34 +1203,6 @@ check_sub_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
1203 | return AE_OK ; | 1203 | return AE_OK ; |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | struct acpiphp_hp_work { | ||
1207 | struct work_struct work; | ||
1208 | acpi_handle handle; | ||
1209 | u32 type; | ||
1210 | void *context; | ||
1211 | }; | ||
1212 | |||
1213 | static void alloc_acpiphp_hp_work(acpi_handle handle, u32 type, | ||
1214 | void *context, | ||
1215 | void (*func)(struct work_struct *work)) | ||
1216 | { | ||
1217 | struct acpiphp_hp_work *hp_work; | ||
1218 | int ret; | ||
1219 | |||
1220 | hp_work = kmalloc(sizeof(*hp_work), GFP_KERNEL); | ||
1221 | if (!hp_work) | ||
1222 | return; | ||
1223 | |||
1224 | hp_work->handle = handle; | ||
1225 | hp_work->type = type; | ||
1226 | hp_work->context = context; | ||
1227 | |||
1228 | INIT_WORK(&hp_work->work, func); | ||
1229 | ret = queue_work(kacpi_hotplug_wq, &hp_work->work); | ||
1230 | if (!ret) | ||
1231 | kfree(hp_work); | ||
1232 | } | ||
1233 | |||
1234 | static void _handle_hotplug_event_bridge(struct work_struct *work) | 1206 | static void _handle_hotplug_event_bridge(struct work_struct *work) |
1235 | { | 1207 | { |
1236 | struct acpiphp_bridge *bridge; | 1208 | struct acpiphp_bridge *bridge; |
@@ -1239,11 +1211,11 @@ static void _handle_hotplug_event_bridge(struct work_struct *work) | |||
1239 | .pointer = objname }; | 1211 | .pointer = objname }; |
1240 | struct acpi_device *device; | 1212 | struct acpi_device *device; |
1241 | int num_sub_bridges = 0; | 1213 | int num_sub_bridges = 0; |
1242 | struct acpiphp_hp_work *hp_work; | 1214 | struct acpi_hp_work *hp_work; |
1243 | acpi_handle handle; | 1215 | acpi_handle handle; |
1244 | u32 type; | 1216 | u32 type; |
1245 | 1217 | ||
1246 | hp_work = container_of(work, struct acpiphp_hp_work, work); | 1218 | hp_work = container_of(work, struct acpi_hp_work, work); |
1247 | handle = hp_work->handle; | 1219 | handle = hp_work->handle; |
1248 | type = hp_work->type; | 1220 | type = hp_work->type; |
1249 | 1221 | ||
@@ -1346,8 +1318,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type, | |||
1346 | * For now just re-add this work to the kacpi_hotplug_wq so we | 1318 | * For now just re-add this work to the kacpi_hotplug_wq so we |
1347 | * don't deadlock on hotplug actions. | 1319 | * don't deadlock on hotplug actions. |
1348 | */ | 1320 | */ |
1349 | alloc_acpiphp_hp_work(handle, type, context, | 1321 | alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_bridge); |
1350 | _handle_hotplug_event_bridge); | ||
1351 | } | 1322 | } |
1352 | 1323 | ||
1353 | static void _handle_hotplug_event_func(struct work_struct *work) | 1324 | static void _handle_hotplug_event_func(struct work_struct *work) |
@@ -1356,12 +1327,12 @@ static void _handle_hotplug_event_func(struct work_struct *work) | |||
1356 | char objname[64]; | 1327 | char objname[64]; |
1357 | struct acpi_buffer buffer = { .length = sizeof(objname), | 1328 | struct acpi_buffer buffer = { .length = sizeof(objname), |
1358 | .pointer = objname }; | 1329 | .pointer = objname }; |
1359 | struct acpiphp_hp_work *hp_work; | 1330 | struct acpi_hp_work *hp_work; |
1360 | acpi_handle handle; | 1331 | acpi_handle handle; |
1361 | u32 type; | 1332 | u32 type; |
1362 | void *context; | 1333 | void *context; |
1363 | 1334 | ||
1364 | hp_work = container_of(work, struct acpiphp_hp_work, work); | 1335 | hp_work = container_of(work, struct acpi_hp_work, work); |
1365 | handle = hp_work->handle; | 1336 | handle = hp_work->handle; |
1366 | type = hp_work->type; | 1337 | type = hp_work->type; |
1367 | context = hp_work->context; | 1338 | context = hp_work->context; |
@@ -1422,8 +1393,7 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type, | |||
1422 | * For now just re-add this work to the kacpi_hotplug_wq so we | 1393 | * For now just re-add this work to the kacpi_hotplug_wq so we |
1423 | * don't deadlock on hotplug actions. | 1394 | * don't deadlock on hotplug actions. |
1424 | */ | 1395 | */ |
1425 | alloc_acpiphp_hp_work(handle, type, context, | 1396 | alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_func); |
1426 | _handle_hotplug_event_func); | ||
1427 | } | 1397 | } |
1428 | 1398 | ||
1429 | static acpi_status | 1399 | static acpi_status |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 2c722deb2490..d26c0d7a6d19 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -310,6 +310,15 @@ struct acpi_eject_event { | |||
310 | u32 event; | 310 | u32 event; |
311 | }; | 311 | }; |
312 | 312 | ||
313 | struct acpi_hp_work { | ||
314 | struct work_struct work; | ||
315 | acpi_handle handle; | ||
316 | u32 type; | ||
317 | void *context; | ||
318 | }; | ||
319 | void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context, | ||
320 | void (*func)(struct work_struct *work)); | ||
321 | |||
313 | extern struct kobject *acpi_kobj; | 322 | extern struct kobject *acpi_kobj; |
314 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); | 323 | extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); |
315 | void acpi_bus_private_data_handler(acpi_handle, void *); | 324 | void acpi_bus_private_data_handler(acpi_handle, void *); |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 43152742b46f..66f1fd70e8c2 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -193,8 +193,6 @@ void acpi_os_fixed_event_count(u32 fixed_event_number); | |||
193 | /* | 193 | /* |
194 | * Threads and Scheduling | 194 | * Threads and Scheduling |
195 | */ | 195 | */ |
196 | extern struct workqueue_struct *kacpi_hotplug_wq; | ||
197 | |||
198 | acpi_thread_id acpi_os_get_thread_id(void); | 196 | acpi_thread_id acpi_os_get_thread_id(void); |
199 | 197 | ||
200 | acpi_status | 198 | acpi_status |