aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/nvec/nvec_power.c
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2013-01-27 17:43:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-29 23:25:10 -0500
commit93eff83ff1640bef8062568687b5e0e41a0d4c42 (patch)
tree384fd726fb069c875f6070da4df4c57a55d33c48 /drivers/staging/nvec/nvec_power.c
parent85a90528b2b4f2d38a56df5b3f137223983aad4b (diff)
staging: nvec: cleanup the string mess
Replace the various command strings by named constants. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec/nvec_power.c')
-rw-r--r--drivers/staging/nvec/nvec_power.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c
index b7b6d54f58e..296f7b9a8c8 100644
--- a/drivers/staging/nvec/nvec_power.c
+++ b/drivers/staging/nvec/nvec_power.c
@@ -22,6 +22,8 @@
#include "nvec.h"
+#define GET_SYSTEM_STATUS 0x00
+
struct nvec_power {
struct notifier_block notifier;
struct delayed_work poller;
@@ -111,7 +113,7 @@ static const int bat_init[] = {
static void get_bat_mfg_data(struct nvec_power *power)
{
int i;
- char buf[] = { '\x02', '\x00' };
+ char buf[] = { NVEC_BAT, SLOT_STATUS };
for (i = 0; i < ARRAY_SIZE(bat_init); i++) {
buf[1] = bat_init[i];
@@ -348,7 +350,7 @@ static int const bat_iter[] = {
static void nvec_power_poll(struct work_struct *work)
{
- char buf[] = { '\x01', '\x00' };
+ char buf[] = { NVEC_SYS, GET_SYSTEM_STATUS };
struct nvec_power *power = container_of(work, struct nvec_power,
poller.work);
@@ -361,7 +363,7 @@ static void nvec_power_poll(struct work_struct *work)
/* select a battery request function via round robin
doing it all at once seems to overload the power supply */
- buf[0] = '\x02'; /* battery */
+ buf[0] = NVEC_BAT;
buf[1] = bat_iter[counter++];
nvec_write_async(power->nvec, buf, 2);