Commit f3fe8bd7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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
parents c49d874b 4f5f64cf
...@@ -226,16 +226,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) ...@@ -226,16 +226,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
struct acpi_memory_info *info; struct acpi_memory_info *info;
int node; int node;
/* Get the range from the _CRS */
result = acpi_memory_get_device_resources(mem_device);
if (result) {
dev_err(&mem_device->device->dev,
"get_device_resources failed\n");
mem_device->state = MEMORY_INVALID_STATE;
return result;
}
node = acpi_get_node(mem_device->device->handle); node = acpi_get_node(mem_device->device->handle);
/* /*
* Tell the VM there is more memory here... * 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,14 +332,6 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
break; break;
} }
if (acpi_memory_check_device(mem_device))
break;
if (acpi_memory_enable_device(mem_device)) {
acpi_handle_err(handle,"Cannot enable memory device\n");
break;
}
ost_code = ACPI_OST_SC_SUCCESS; ost_code = ACPI_OST_SC_SUCCESS;
break; break;
......
...@@ -111,8 +111,17 @@ static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf, ...@@ -111,8 +111,17 @@ static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf,
if (rc) if (rc)
goto out; goto out;
/* no more record */ /* no more record */
if (id == APEI_ERST_INVALID_RECORD_ID) if (id == APEI_ERST_INVALID_RECORD_ID) {
/*
* If the persistent store is empty initially, the function
* 'erst_read' below will return "-ENOENT" value. This causes
* 'retry_next' label is entered again. The returned value
* should be zero indicating the read operation is EOF.
*/
len = 0;
goto out; goto out;
}
retry: retry:
rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len); rc = len = erst_read(id, erst_dbg_buf, erst_dbg_buf_len);
/* The record may be cleared by others, try read next record */ /* The record may be cleared by others, try read next record */
......
...@@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_get_node(struct device *dev) ...@@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
acpi_handle handle = DEVICE_ACPI_HANDLE(dev); acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
struct acpi_device *adev; struct acpi_device *adev;
return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ? return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
adev : NULL;
} }
/** /**
......
...@@ -18,9 +18,14 @@ ...@@ -18,9 +18,14 @@
#define ACPI_GLUE_DEBUG 0 #define ACPI_GLUE_DEBUG 0
#if ACPI_GLUE_DEBUG #if ACPI_GLUE_DEBUG
#define DBG(x...) printk(PREFIX x) #define DBG(fmt, ...) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__)
#else #else
#define DBG(x...) do { } while(0) #define DBG(fmt, ...) \
do { \
if (0) \
printk(KERN_DEBUG PREFIX fmt, ##__VA_ARGS__); \
} while (0)
#endif #endif
static LIST_HEAD(bus_type_list); static LIST_HEAD(bus_type_list);
static DECLARE_RWSEM(bus_type_sem); static DECLARE_RWSEM(bus_type_sem);
......
...@@ -445,11 +445,8 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle) ...@@ -445,11 +445,8 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
return -ENODEV; return -ENODEV;
ret = acpi_bus_get_device(handle, &acpi_dev); ret = acpi_bus_get_device(handle, &acpi_dev);
if (ret) if (ret || !acpi_dev->power.flags.power_resources)
goto no_power_resource; return -ENODEV;
if (!acpi_dev->power.flags.power_resources)
goto no_power_resource;
powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL); powered_device = kzalloc(sizeof(*powered_device), GFP_KERNEL);
if (!powered_device) if (!powered_device)
...@@ -471,10 +468,6 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle) ...@@ -471,10 +468,6 @@ int acpi_power_resource_register_device(struct device *dev, acpi_handle handle)
} }
return ret; return ret;
no_power_resource:
printk(KERN_DEBUG PREFIX "Invalid Power Resource to register!\n");
return -ENODEV;
} }
EXPORT_SYMBOL_GPL(acpi_power_resource_register_device); EXPORT_SYMBOL_GPL(acpi_power_resource_register_device);
......
...@@ -1346,7 +1346,7 @@ static void acpi_device_set_id(struct acpi_device *device) ...@@ -1346,7 +1346,7 @@ static void acpi_device_set_id(struct acpi_device *device)
acpi_add_id(device, ACPI_DOCK_HID); acpi_add_id(device, ACPI_DOCK_HID);
else if (!acpi_ibm_smbus_match(device)) else if (!acpi_ibm_smbus_match(device))
acpi_add_id(device, ACPI_SMBUS_IBM_HID); acpi_add_id(device, ACPI_SMBUS_IBM_HID);
else if (!acpi_device_hid(device) && else if (list_empty(&device->pnp.ids) &&
ACPI_IS_ROOT_DEVICE(device->parent)) { ACPI_IS_ROOT_DEVICE(device->parent)) {
acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME); strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment