[<prev] [next>] [day] [month] [year] [list]
Message-ID: <b9df5fa11002282157x3c0eec13q4ad404bbe2f227d7@mail.gmail.com>
Date: Mon, 1 Mar 2010 11:57:38 +0600
From: Rakib Mullick <rakib.mullick@...il.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Len Brown <lenb@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] acpi: Put acpi_battery_get/set_alarm into
CONFIG_ACPI_SYSFS_POWER
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@...il.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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists