From patchwork Tue Mar 11 17:58:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Mezin X-Patchwork-Id: 3813661 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 700D3BF540 for ; Tue, 11 Mar 2014 18:01:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4746A2021A for ; Tue, 11 Mar 2014 18:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 669492020E for ; Tue, 11 Mar 2014 18:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbaCKSBk (ORCPT ); Tue, 11 Mar 2014 14:01:40 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:65482 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753189AbaCKSBj (ORCPT ); Tue, 11 Mar 2014 14:01:39 -0400 Received: by mail-lb0-f178.google.com with SMTP id s7so5990930lbd.9 for ; Tue, 11 Mar 2014 11:01:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=HMuJ7uvauIIK2tmX7jiUNmbc/SNnS4B8YREBV+b3pRU=; b=NO6T7ohdbkZA6KHSDKMc8WkQkmwb2KnNTDEUgo3gs2lXEagR3RC3kissgxEkpQWrz1 QBdIxArzTto6VRDh7zsIoEEymI06YfCScPLK+XUCYtZT28HS3Wn2EDr98sqMXmklSEWJ wORDaZWbmeAdaiCeKXKaC+0Nt+39kd28PpEPQWc6+tpugO2f5Y7iEAYG9ACgNJtQQuUK 8PvkcquSQnVCg6wTQGA80qq5q1ynb0BpfIoKXAESEWuUJhonfD9js+JUKh2jQD8xyMKa nuiEkVzONSrqEIMUtBvdmLmXopQb9++F1GhHJ4EaEEvMenfA+2H7+Fnf6vOz1DtEEzYO NC2Q== X-Received: by 10.152.27.226 with SMTP id w2mr45112lag.84.1394560898402; Tue, 11 Mar 2014 11:01:38 -0700 (PDT) Received: from localhost.localdomain ([188.232.137.148]) by mx.google.com with ESMTPSA id x4sm25908186lbn.2.2014.03.11.11.01.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Mar 2014 11:01:37 -0700 (PDT) From: Alexander Mezin To: linux-acpi@vger.kernel.org Cc: Alexander Mezin Subject: [PATCH v2 1/3] ACPI / battery: move some ACPI_BATTERY_* definitions to header Date: Wed, 12 Mar 2014 00:58:46 +0700 Message-Id: <1394560728-14048-1-git-send-email-mezin.alexander@gmail.com> X-Mailer: git-send-email 1.9.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPI_BATTERY_CLASS is used in multiple places. Also, I'll use ACPI_BATTERY_NOTIFY_STATUS inside AC driver in one of following patches. So, create a header file and move ACPI_BATTERY_CLASS and ACPI_BATTERY_NOTIFY_* definitions into it. Also, remove copy of ACPI_BATTERY_CLASS from sbs.c Signed-off-by: Alexander Mezin --- v2: move ACPI_BATTERY_NOTIFY_* to header too drivers/acpi/battery.c | 6 ++---- drivers/acpi/battery.h | 10 ++++++++++ drivers/acpi/sbs.c | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 drivers/acpi/battery.h diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 797a693..bfec70f 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -39,15 +39,13 @@ #include #include +#include "battery.h" + #define PREFIX "ACPI: " #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF -#define ACPI_BATTERY_CLASS "battery" #define ACPI_BATTERY_DEVICE_NAME "Battery" -#define ACPI_BATTERY_NOTIFY_STATUS 0x80 -#define ACPI_BATTERY_NOTIFY_INFO 0x81 -#define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82 /* Battery power unit: 0 means mW, 1 means mA */ #define ACPI_BATTERY_POWER_UNIT_MA 1 diff --git a/drivers/acpi/battery.h b/drivers/acpi/battery.h new file mode 100644 index 0000000..6c08497 --- /dev/null +++ b/drivers/acpi/battery.h @@ -0,0 +1,10 @@ +#ifndef __ACPI_BATTERY_H +#define __ACPI_BATTERY_H + +#define ACPI_BATTERY_CLASS "battery" + +#define ACPI_BATTERY_NOTIFY_STATUS 0x80 +#define ACPI_BATTERY_NOTIFY_INFO 0x81 +#define ACPI_BATTERY_NOTIFY_THRESHOLD 0x82 + +#endif diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index dbd4849..366ca40 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -37,12 +37,12 @@ #include #include "sbshc.h" +#include "battery.h" #define PREFIX "ACPI: " #define ACPI_SBS_CLASS "sbs" #define ACPI_AC_CLASS "ac_adapter" -#define ACPI_BATTERY_CLASS "battery" #define ACPI_SBS_DEVICE_NAME "Smart Battery System" #define ACPI_SBS_FILE_INFO "info" #define ACPI_SBS_FILE_STATE "state"