From: Rakib Mullick <rakib.mullick@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Len Brown <lenb@kernel.org>, Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] acpi: Put acpi_battery_get/set_alarm into CONFIG_ACPI_SYSFS_POWER
Date: Mon, 1 Mar 2010 11:57:38 +0600 [thread overview]
Message-ID: <b9df5fa11002282157x3c0eec13q4ad404bbe2f227d7@mail.gmail.com> (raw)
acpi_battery_get/set_alarm is only used when CONFIG_ACPI_SYSFS_POWER=y. So
put this two functions under CONFIG_ACPI_SYSFS_POWER by shifting it upward.
We were warned by the following warnings:
drivers/acpi/sbs.c:399: warning: ‘acpi_battery_get_alarm’ defined but not used
drivers/acpi/sbs.c:406: warning: ‘acpi_battery_set_alarm’ defined but not used
Also fixes a checkpatch warning in acpi_ac_get_present.
ERROR: space prohibited after that '&' (ctx:WxW)
#13: FILE: drivers/acpi/sbs.c:405:
+ 0x13, (u8 *) & status);
^
---
Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
--- linux-33/drivers/acpi/sbs.c 2010-02-26 16:30:32.000000000 +0600
+++ linux-project/drivers/acpi/sbs.c 2010-03-01 11:02:32.000000000 +0600
@@ -396,6 +396,20 @@ static int acpi_battery_get_state(struct
return result;
}
+static int acpi_ac_get_present(struct acpi_sbs *sbs)
+{
+ int result;
+ u16 status;
+
+ result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_CHARGER,
+ 0x13, (u8 *) &status);
+ if (!result)
+ sbs->charger_present = (status >> 15) & 0x1;
+ return result;
+}
+
+#ifdef CONFIG_ACPI_SYSFS_POWER
+
static int acpi_battery_get_alarm(struct acpi_battery *battery)
{
return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
@@ -432,19 +446,6 @@ static int acpi_battery_set_alarm(struct
return ret;
}
-static int acpi_ac_get_present(struct acpi_sbs *sbs)
-{
- int result;
- u16 status;
-
- result = acpi_smbus_read(sbs->hc, SMBUS_READ_WORD, ACPI_SBS_CHARGER,
- 0x13, (u8 *) & status);
- if (!result)
- sbs->charger_present = (status >> 15) & 0x1;
- return result;
-}
-
-#ifdef CONFIG_ACPI_SYSFS_POWER
static ssize_t acpi_battery_alarm_show(struct device *dev,
struct device_attribute *attr,
char *buf)
reply other threads:[~2010-03-01 6:05 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=b9df5fa11002282157x3c0eec13q4ad404bbe2f227d7@mail.gmail.com \
--to=rakib.mullick@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®