From patchwork Tue May 12 14:50:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 23256 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4CEp7J5025898 for ; Tue, 12 May 2009 14:51:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752663AbZELOvE (ORCPT ); Tue, 12 May 2009 10:51:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752913AbZELOvE (ORCPT ); Tue, 12 May 2009 10:51:04 -0400 Received: from mail-ew0-f176.google.com ([209.85.219.176]:43172 "EHLO mail-ew0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbZELOvB (ORCPT ); Tue, 12 May 2009 10:51:01 -0400 Received: by ewy24 with SMTP id 24so26527ewy.37 for ; Tue, 12 May 2009 07:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=IWT6GLboh5xdwK/H/VJBJBo2Wr5aTEQ6fZMk1MFx6vA=; b=iyol1Mvfhy/pyOnU2GosXncsxsKUbDjsKlDeOjGChXvkEf3PO/q5YZUH27fPoPATKU 6Fw7fHzXSn8AB6mdJnTBEsYTSgfk48VfEisZBY6gg+ytAFrCHpUcYsFpFQhMfYh4K3Mj ubd6TrN9AnV5VU3LJbchlW+XVsyYvwYkpDvh8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=LbvGsU3w22VKA0ZzMCY4TkL60mLFXI6se43MaLWkuI8H/0DDMOxUcNDv3H3NIFwMtC SFN3zFDhrcTshzaJv1ecIXlUvUmd44k2aP1KuasBuWmIo+EqoF1abv88fpKcGOTxy+BS +4gGbgHBe20okWzYLmfjRuVI5Uhnvyfa4AM/w= Received: by 10.216.8.209 with SMTP id 59mr4014432wer.18.1242139861029; Tue, 12 May 2009 07:51:01 -0700 (PDT) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 7sm289073eyb.45.2009.05.12.07.51.00 (version=SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 07:51:00 -0700 (PDT) Message-ID: <4A098CD2.2030608@tuffmail.co.uk> Date: Tue, 12 May 2009 15:50:58 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: linux acpi CC: Alexey Starikovskiy Subject: [PATCH] ACPI: battery drivers should call power_supply_changed() Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- 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 --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 } }