diff mbox

ACPI: Fix /proc/acpi/wakeup for devices w/o bus or parent

Message ID 51053713.6090804@gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andreas Fleig Jan. 27, 2013, 2:17 p.m. UTC
Fix /proc/acpi/wakeup for devices without bus or parent

This patch fixes printing the wakeup status for devices without a bus
or parent, such as laptop lid switches and sleep buttons. These devices
have an empty physical_node_list, because acpi_bind_one is never run
for them.

Signed-off-by: Andreas Fleig <andreasfleig@gmail.com>
---
  			list_for_each_entry(entry, &dev->physical_node_list,
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rafael Wysocki Jan. 27, 2013, 10:46 p.m. UTC | #1
On Sunday, January 27, 2013 03:17:55 PM Andreas Fleig wrote:
> Fix /proc/acpi/wakeup for devices without bus or parent
> 
> This patch fixes printing the wakeup status for devices without a bus
> or parent, such as laptop lid switches and sleep buttons. These devices
> have an empty physical_node_list, because acpi_bind_one is never run
> for them.
> 
> Signed-off-by: Andreas Fleig <andreasfleig@gmail.com>

OK, I'm going to take this (but I'm going to fix white space while applying it).

Thanks,
Rafael


> ---
> diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
> index 27adb09..3623ea8 100644
> --- a/drivers/acpi/proc.c
> +++ b/drivers/acpi/proc.c
> @@ -314,7 +314,8 @@ acpi_system_wakeup_device_seq_show(struct seq_file 
> *seq, void *offset)
>   		if (!dev->physical_node_count)
>   			seq_printf(seq, "%c%-8s\n",
>   				dev->wakeup.flags.run_wake ?
> -				'*' : ' ', "disabled");
> +				'*' : ' ', device_may_wakeup(&dev->dev) ?
> +				"enabled" : "disabled");
>   		else {
>   			struct device *ldev;
>   			list_for_each_entry(entry, &dev->physical_node_list,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
index 27adb09..3623ea8 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
@@ -314,7 +314,8 @@  acpi_system_wakeup_device_seq_show(struct seq_file 
*seq, void *offset)
  		if (!dev->physical_node_count)
  			seq_printf(seq, "%c%-8s\n",
  				dev->wakeup.flags.run_wake ?
-				'*' : ' ', "disabled");
+				'*' : ' ', device_may_wakeup(&dev->dev) ?
+				"enabled" : "disabled");
  		else {
  			struct device *ldev;