* [PATCH] acpi: Put acpi_battery_get/set_alarm into CONFIG_ACPI_SYSFS_POWER
@ 2010-03-01 5:57 Rakib Mullick
0 siblings, 0 replies; only message in thread
From: Rakib Mullick @ 2010-03-01 5:57 UTC (permalink / raw)
To: LKML; +Cc: Len Brown, Andrew Morton
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-01 6:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-01 5:57 [PATCH] acpi: Put acpi_battery_get/set_alarm into CONFIG_ACPI_SYSFS_POWER Rakib Mullick
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®