diff mbox

[2/3] ACPI / battery: call ACPI notifier chain in acpi_battery_notify

Message ID 1394452061-27777-2-git-send-email-mezin.alexander@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Aleksandr Mezin March 10, 2014, 11:47 a.m. UTC
Allow other drivers to subscribe to battery status notifications.
Just like AC driver does.

Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>
---
 drivers/acpi/battery.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tianyu Lan March 11, 2014, 5:47 a.m. UTC | #1
2014-03-10 19:47 GMT+08:00 Alexander Mezin <mezin.alexander@gmail.com>:
> Allow other drivers to subscribe to battery status notifications.
> Just like AC driver does.
>

Acked-by: Lan Tianyu <tianyu.lan@intel.com>

> Signed-off-by: Alexander Mezin <mezin.alexander@gmail.com>
> ---
>  drivers/acpi/battery.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 0a19c8f..861e585 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -737,6 +737,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
>         acpi_bus_generate_netlink_event(device->pnp.device_class,
>                                         dev_name(&device->dev), event,
>                                         acpi_battery_present(battery));
> +       acpi_notifier_call_chain(device, event, acpi_battery_present(battery));
>         /* acpi_battery_update could remove power_supply object */
>         if (old && battery->bat.dev)
>                 power_supply_changed(&battery->bat);
> --
> 1.9.0
>
> --
> 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/battery.c b/drivers/acpi/battery.c
index 0a19c8f..861e585 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -737,6 +737,7 @@  static void acpi_battery_notify(struct acpi_device *device, u32 event)
 	acpi_bus_generate_netlink_event(device->pnp.device_class,
 					dev_name(&device->dev), event,
 					acpi_battery_present(battery));
+	acpi_notifier_call_chain(device, event, acpi_battery_present(battery));
 	/* acpi_battery_update could remove power_supply object */
 	if (old && battery->bat.dev)
 		power_supply_changed(&battery->bat);