diff mbox

ACPI / AC: change notification handler type to ACPI_ALL_NOTIFY

Message ID 1388801279-15502-1-git-send-email-mezin.alexander@gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Aleksandr Mezin Jan. 4, 2014, 2:07 a.m. UTC
With kernel 3.13rc5 there are no AC adapter notifications on my laptop.

Commit cc8ef52707341e67a12067d6ead991d56ea017ca
"ACPI / AC: convert ACPI ac driver to platform bus" changed the driver
to listen only to device notifications. However, aml code on my laptop
notifies the driver with zero event.

This patch changes the driver to listen to all events again.

References: https://bugzilla.kernel.org/show_bug.cgi?id=67821

Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>
---
 drivers/acpi/ac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Jan. 5, 2014, 10:11 p.m. UTC | #1
On Saturday, January 04, 2014 09:07:59 AM Alexander Mezin wrote:
> With kernel 3.13rc5 there are no AC adapter notifications on my laptop.
> 
> Commit cc8ef52707341e67a12067d6ead991d56ea017ca
> "ACPI / AC: convert ACPI ac driver to platform bus" changed the driver
> to listen only to device notifications. However, aml code on my laptop
> notifies the driver with zero event.
> 
> This patch changes the driver to listen to all events again.
> 
> References: https://bugzilla.kernel.org/show_bug.cgi?id=67821
> 
> Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>

Queued up as a regression fix for 3.13, thanks!

> ---
>  drivers/acpi/ac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
> index 8711e37..3c2e4aa 100644
> --- a/drivers/acpi/ac.c
> +++ b/drivers/acpi/ac.c
> @@ -207,7 +207,7 @@ static int acpi_ac_probe(struct platform_device *pdev)
>  		goto end;
>  
>  	result = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev),
> -			ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler, ac);
> +			ACPI_ALL_NOTIFY, acpi_ac_notify_handler, ac);
>  	if (result) {
>  		power_supply_unregister(&ac->charger);
>  		goto end;
> @@ -255,7 +255,7 @@ static int acpi_ac_remove(struct platform_device *pdev)
>  		return -EINVAL;
>  
>  	acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev),
> -			ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler);
> +			ACPI_ALL_NOTIFY, acpi_ac_notify_handler);
>  
>  	ac = platform_get_drvdata(pdev);
>  	if (ac->charger.dev)
>
diff mbox

Patch

diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 8711e37..3c2e4aa 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -207,7 +207,7 @@  static int acpi_ac_probe(struct platform_device *pdev)
 		goto end;
 
 	result = acpi_install_notify_handler(ACPI_HANDLE(&pdev->dev),
-			ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler, ac);
+			ACPI_ALL_NOTIFY, acpi_ac_notify_handler, ac);
 	if (result) {
 		power_supply_unregister(&ac->charger);
 		goto end;
@@ -255,7 +255,7 @@  static int acpi_ac_remove(struct platform_device *pdev)
 		return -EINVAL;
 
 	acpi_remove_notify_handler(ACPI_HANDLE(&pdev->dev),
-			ACPI_DEVICE_NOTIFY, acpi_ac_notify_handler);
+			ACPI_ALL_NOTIFY, acpi_ac_notify_handler);
 
 	ac = platform_get_drvdata(pdev);
 	if (ac->charger.dev)