aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-04 17:10:29 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-04 17:10:29 -0500
commitf3fe8bd7b114d88c802616a98a0cf69299c37ed3 (patch)
treeae98aa0acb783c5f8e57bd29ca8ede44d569b444 /drivers/acpi
parentc49d874bafd0a63379294ebd3531c41f9fcebc7d (diff)
parent4f5f64cf0cc916220aaa055992e31195470cfe37 (diff)
Merge branch 'acpi-assorted'
* acpi-assorted: ACPI / scan: Do not use dummy HID for system bus ACPI nodes ACPI / power: Remove useless message from device registering routine ACPI / glue: Update DBG macro to include KERN_DEBUG ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result ACPI / memhotplug: remove redundant logic of acpi memory hotadd ACPI / APEI: Fix the returned value in erst_dbg_read
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c18
-rw-r--r--drivers/acpi/apei/erst-dbg.c11
-rw-r--r--drivers/acpi/device_pm.c3
-rw-r--r--drivers/acpi/glue.c9
-rw-r--r--drivers/acpi/power.c11
-rw-r--r--drivers/acpi/scan.c2
6 files changed, 21 insertions, 33 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index eb30e5ab4cab..b679bf8478f7 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -226,16 +226,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
226 struct acpi_memory_info *info; 226 struct acpi_memory_info *info;
227 int node; 227 int node;
228 228
229
230 /* Get the range from the _CRS */
231 result = acpi_memory_get_device_resources(mem_device);
232 if (result) {
233 dev_err(&mem_device->device->dev,
234 "get_device_resources failed\n");
235 mem_device->state = MEMORY_INVALID_STATE;
236 return result;
237 }
238
239 node = acpi_get_node(mem_device->device->handle); 229 node = acpi_get_node(mem_device->device->handle);
240 /* 230 /*
241 * Tell the VM there is more memory here... 231 * Tell the VM there is more memory here...
@@ -342,14 +332,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
342 break; 332 break;
343 } 333 }
344 334
345 if (acpi_memory_check_device(mem_device))
346 break;
347
348 if (acpi_memory_enable_device(mem_device)) {
349 acpi_handle_err(handle,"Cannot enable memory device\n");
350 break;
351 }
352
353 ost_code = ACPI_OST_SC_SUCCESS; 335 ost_code = ACPI_OST_SC_SUCCESS;
354 break; 336 break;
355 337
diff --git a/drivers/acpi/apei/erst-dbg.c b/drivers/acpi/apei/erst-dbg.c
index 903549df809b..04ab5c9d3ced 100644
--- a/drivers/acpi/apei/erst-dbg.c
+++ b/drivers/acpi/apei/erst-dbg.c
@@ -111,8 +111,17 @@ retry_next:
111 if (rc) 111 if (rc)
112 goto out; 112 goto out;
113 /* no more record */ 113 /* no more record */
114 if (id == APEI_ERST_INVALID_RECORD_ID) 114 if (id == APEI_ERST_INVALID_RECORD_ID) {
115 /*
116 * If the persistent store is empty initially, the function
117 * 'erst_read' below will return "-ENOENT" value. This causes
118 * 'retry_next' label is entered again. The returned value
119 * should be zero indicating the read operation is EOF.
120 */
121 len = 0;
122
115 goto out; 123 goto out;
124 }
116retry: 125retry:
117 rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len); 126 rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len);
118 /* The record may be cleared by others, try read next record */ 127 /* The record may be cleared by others, try read next record */
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index f09dc987cf17..c6ff606c6d5b 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
358 acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 358 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
359 struct acpi_device *adev; 359 struct acpi_device *adev;
360 360
361 return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ? 361 return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
362 adev : NULL;
363} 362}
364 363
365/** 364/**
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 01551840d236..95af6f674a6c 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -18,9 +18,14 @@
18 18
19#define ACPI_GLUE_DEBUG 0 19#define ACPI_GLUE_DEBUG 0
20#if ACPI_GLUE_DEBUG 20#if ACPI_GLUE_DEBUG
21#define DBG(x...) printk(PREFIX x) 21#define DBG(fmt, ...) \
22 printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__)
22#else 23#else
23#define DBG(x...) do { } while(0) 24#define DBG(fmt, ...) \
25do { \
26 if (0) \
27 printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__); \
28} while (0)
24#endif 29#endif
25static LIST_HEAD(bus_type_list); 30static LIST_HEAD(bus_type_list);
26static DECLARE_RWSEM(bus_type_sem); 31static DECLARE_RWSEM(bus_type_sem);
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 7db61b8fa11f..6e7b9d523812 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -445,11 +445,8 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
445 return -ENODEV; 445 return -ENODEV;
446 446
447 ret = acpi_bus_get_device(handle, &acpi_dev); 447 ret = acpi_bus_get_device(handle, &acpi_dev);
448 if (ret) 448 if (ret || !acpi_dev->power.flags.power_resources)
449 goto no_power_resource; 449 return -ENODEV;
450
451 if (!acpi_dev->power.flags.power_resources)
452 goto no_power_resource;
453 450
454 powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL); 451 powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL);
455 if (!powered_device) 452 if (!powered_device)
@@ -471,10 +468,6 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
471 } 468 }
472 469
473 return ret; 470 return ret;
474
475no_power_resource:
476 printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!\n");
477 return -ENODEV;
478} 471}
479EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); 472EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);
480 473
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 53502d1bbf26..c88be6c37c30 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1346,7 +1346,7 @@ static void acpi_device_set_id(struct acpi_device *device)
1346 acpi_add_id(device, ACPI_DOCK_HID); 1346 acpi_add_id(device, ACPI_DOCK_HID);
1347 else if (!acpi_ibm_smbus_match(device)) 1347 else if (!acpi_ibm_smbus_match(device))
1348 acpi_add_id(device, ACPI_SMBUS_IBM_HID); 1348 acpi_add_id(device, ACPI_SMBUS_IBM_HID);
1349 else if (!acpi_device_hid(device) && 1349 else if (list_empty(&device->pnp.ids) &&
1350 ACPI_IS_ROOT_DEVICE(device->parent)) { 1350 ACPI_IS_ROOT_DEVICE(device->parent)) {
1351 acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ 1351 acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
1352 strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME); 1352 strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);