All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux acpi <linux-acpi@vger.kernel.org>
Cc: Alexey Starikovskiy <astarikovskiy@suse.de>
Subject: [PATCH] ACPI: battery drivers should call power_supply_changed()
Date: Tue, 12 May 2009 15:50:58 +0100	[thread overview]
Message-ID: <4A098CD2.2030608@tuffmail.co.uk> (raw)

Calling kobject_uevent() directly is a layering violation.  In
particular, it means we'll miss updating the generic LED trigger.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 2ccc87e..9208e97 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -812,7 +812,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
 #ifdef CONFIG_ACPI_SYSFS_POWER
 	/* acpi_batter_update could remove power_supply object */
 	if (battery->bat.dev)
-		kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
+		power_supply_changed(&battery->bat);
 #endif
 }
 
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 4b214b7..dfa9455 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -890,7 +890,7 @@ static void acpi_sbs_callback(void *context)
 					      sbs->charger_present);
 #endif
 #ifdef CONFIG_ACPI_SYSFS_POWER
-		kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE);
+		power_supply_changed(&sbs->charger);
 #endif
 	}
 	if (sbs->manager_present) {
@@ -909,7 +909,7 @@ static void acpi_sbs_callback(void *context)
 						      bat->present);
 #endif
 #ifdef CONFIG_ACPI_SYSFS_POWER
-			kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE);
+			power_supply_changed(&bat->bat);
 #endif
 		}
 	}



                 reply	other threads:[~2009-05-12 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A098CD2.2030608@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=astarikovskiy@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.