aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2013-01-21 16:20:47 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-01-25 16:43:22 -0500
commit92d8aff3a317fcd6f78ed9ac13dbbaeae8cb11ed (patch)
treed55492edb9abed37b88b25be4fef30a840d0200a /drivers/pci
parente723f0b4f4ecaf3fdd542124b3f99379ab8df757 (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
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c42
1 files changed, 6 insertions, 36 deletions
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
1206struct acpiphp_hp_work {
1207 struct work_struct work;
1208 acpi_handle handle;
1209 u32 type;
1210 void *context;
1211};
1212
1213static 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
1234static void _handle_hotplug_event_bridge(struct work_struct *work) 1206static 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
1353static void _handle_hotplug_event_func(struct work_struct *work) 1324static 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
1429static acpi_status 1399static acpi_status