lkml.org 
[lkml]   [2010]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] acpi: Put acpi_battery_get/set_alarm into CONFIG_ACPI_SYSFS_POWER
From
 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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2010-03-01 07:07    [W:0.023 / U:1.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site