aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/thinkpad_acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r--drivers/misc/thinkpad_acpi.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 7aed118ca82b..68f1cc0d7fae 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -296,14 +296,22 @@ static void drv_acpi_handle_init(char *name,
296 int i; 296 int i;
297 acpi_status status; 297 acpi_status status;
298 298
299 vdbg_printk(TPACPI_DBG_INIT, "trying to locate ACPI handle for %s\n",
300 name);
301
299 for (i = 0; i < num_paths; i++) { 302 for (i = 0; i < num_paths; i++) {
300 status = acpi_get_handle(parent, paths[i], handle); 303 status = acpi_get_handle(parent, paths[i], handle);
301 if (ACPI_SUCCESS(status)) { 304 if (ACPI_SUCCESS(status)) {
302 *path = paths[i]; 305 *path = paths[i];
306 dbg_printk(TPACPI_DBG_INIT,
307 "Found ACPI handle %s for %s\n",
308 *path, name);
303 return; 309 return;
304 } 310 }
305 } 311 }
306 312
313 vdbg_printk(TPACPI_DBG_INIT, "ACPI handle for %s not found\n",
314 name);
307 *handle = NULL; 315 *handle = NULL;
308} 316}
309 317
@@ -320,19 +328,20 @@ static void dispatch_acpi_notify(acpi_handle handle, u32 event, void *data)
320static int __init setup_acpi_notify(struct ibm_struct *ibm) 328static int __init setup_acpi_notify(struct ibm_struct *ibm)
321{ 329{
322 acpi_status status; 330 acpi_status status;
323 int ret; 331 int rc;
324 332
325 BUG_ON(!ibm->acpi); 333 BUG_ON(!ibm->acpi);
326 334
327 if (!*ibm->acpi->handle) 335 if (!*ibm->acpi->handle)
328 return 0; 336 return 0;
329 337
330 dbg_printk(TPACPI_DBG_INIT, 338 vdbg_printk(TPACPI_DBG_INIT,
331 "setting up ACPI notify for %s\n", ibm->name); 339 "setting up ACPI notify for %s\n", ibm->name);
332 340
333 ret = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device); 341 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
334 if (ret < 0) { 342 if (rc < 0) {
335 printk(IBM_ERR "%s device not present\n", ibm->name); 343 printk(IBM_ERR "acpi_bus_get_device(%s) failed: %d\n",
344 ibm->name, rc);
336 return -ENODEV; 345 return -ENODEV;
337 } 346 }
338 347
@@ -364,7 +373,7 @@ static int __init tpacpi_device_add(struct acpi_device *device)
364 373
365static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) 374static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
366{ 375{
367 int ret; 376 int rc;
368 377
369 dbg_printk(TPACPI_DBG_INIT, 378 dbg_printk(TPACPI_DBG_INIT,
370 "registering %s as an ACPI driver\n", ibm->name); 379 "registering %s as an ACPI driver\n", ibm->name);
@@ -381,16 +390,16 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
381 ibm->acpi->driver->ids = ibm->acpi->hid; 390 ibm->acpi->driver->ids = ibm->acpi->hid;
382 ibm->acpi->driver->ops.add = &tpacpi_device_add; 391 ibm->acpi->driver->ops.add = &tpacpi_device_add;
383 392
384 ret = acpi_bus_register_driver(ibm->acpi->driver); 393 rc = acpi_bus_register_driver(ibm->acpi->driver);
385 if (ret < 0) { 394 if (rc < 0) {
386 printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n", 395 printk(IBM_ERR "acpi_bus_register_driver(%s) failed: %d\n",
387 ibm->acpi->hid, ret); 396 ibm->acpi->hid, rc);
388 kfree(ibm->acpi->driver); 397 kfree(ibm->acpi->driver);
389 ibm->acpi->driver = NULL; 398 ibm->acpi->driver = NULL;
390 } else if (!ret) 399 } else if (!rc)
391 ibm->flags.acpi_driver_registered = 1; 400 ibm->flags.acpi_driver_registered = 1;
392 401
393 return ret; 402 return rc;
394} 403}
395 404
396 405