Skip to contentSkip to conversation

z2-battery: Fix count of properties

PATCH Superseded Vasily Khoruzhick 4 participants 5 messages Mar 11, 2011 – Mar 16, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 z2-battery: Fix count of properties

PROP_STATUS property was not counted, as result
VOLTAGE_MIN property is missing in sysfs. Fix it.

---
 drivers/power/z2_battery.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/power/z2_battery.c +2 -0
index e5ed52d..551d7bf 100644
@@ -134,6 +134,8 @@ static int z2_batt_ps_init(struct z2_charger *charger, int props)
 	enum power_supply_property *prop;
 	struct z2_battery_info *info = charger->info;
 
+	if (info->charge_gpio >= 0)
+		props++; /* POWER_SUPPLY_PROP_STATUS */
 	if (info->batt_tech >= 0)
 		props++;	/* POWER_SUPPLY_PROP_TECHNOLOGY */
 	if (info->batt_I2C_reg >= 0)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 z2-battery: Fix count of properties

Hello.

Quoted 13 lines · Vasily Khoruzhick

PROP_STATUS property was not counted, as result
VOLTAGE_MIN property is missing in sysfs. Fix it.

---
  drivers/power/z2_battery.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
drivers/power/z2_battery.c +0 -0
index e5ed52d..551d7bf 100644

drivers/power/z2_battery.c static int z2_batt_ps_init(struct z2_charger *charger, int props) · line 138

Quoted 5 lines
drivers/power/z2_battery.c +2 -0
@@ -134,6 +134,8 @@ static int z2_batt_ps_init(struct z2_charger *charger, int props)
  	enum power_supply_property *prop;
  	struct z2_battery_info *info = charger->info;
 
+	if (info->charge_gpio>= 0)
+		props++; /* POWER_SUPPLY_PROP_STATUS */

Why not align this comment with the below one?

drivers/power/z2_battery.c static int z2_batt_ps_init(struct z2_charger *charger, int props) · line 141

Quoted 3 lines
drivers/power/z2_battery.c +0 -0
  	if (info->batt_tech>= 0)
  		props++;	/* POWER_SUPPLY_PROP_TECHNOLOGY */
  	if (info->batt_I2C_reg>= 0)

WBR, Sergei

#2 lore raw

PATCH v2 1/1 z2-battery: Fix count of properties

PROP_STATUS property was not counted, as result
VOLTAGE_MIN property is missing in sysfs. Fix it.

---
v2: Align comment properly

 drivers/power/z2_battery.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/power/z2_battery.c +2 -0
index 81304c0..2a9ab89 100644
@@ -134,6 +134,8 @@ static int z2_batt_ps_init(struct z2_charger *charger, int props)
 	enum power_supply_property *prop;
 	struct z2_battery_info *info = charger->info;
 
+	if (info->charge_gpio >= 0)
+		props++;	/* POWER_SUPPLY_PROP_STATUS */
 	if (info->batt_tech >= 0)
 		props++;	/* POWER_SUPPLY_PROP_TECHNOLOGY */
 	if (info->batt_I2C_reg >= 0)
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH v2 1/1 z2-battery: Fix count of properties

Quoted 4 lines · On Friday 11 March 2011 14:09:32 Vasily Khoruzhick wrote:

PROP_STATUS property was not counted, as result
VOLTAGE_MIN property is missing in sysfs. Fix it.

You can have my:

on this one.

Quoted 19 lines

---
v2: Align comment properly

 drivers/power/z2_battery.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/power/z2_battery.c +2 -0
index 81304c0..2a9ab89 100644
@@ -134,6 +134,8 @@ static int z2_batt_ps_init(struct z2_charger *charger,
 int props) enum power_supply_property *prop;
 	struct z2_battery_info *info = charger->info;
 
+	if (info->charge_gpio >= 0)
+		props++;	/* POWER_SUPPLY_PROP_STATUS */
 	if (info->batt_tech >= 0)
 		props++;	/* POWER_SUPPLY_PROP_TECHNOLOGY */
 	if (info->batt_I2C_reg >= 0)
#4 lore raw

PATCH v2 1/1 z2-battery: Fix count of properties

Quoted 11 lines · Marek Vasut
Quoted 4 lines · On Friday 11 March 2011 14:09:32 Vasily Khoruzhick wrote:

PROP_STATUS property was not counted, as result
VOLTAGE_MIN property is missing in sysfs. Fix it.

You can have my:

on this one.

Applied, thanks guys!

Signature · 2 lines
Anton Vorontsov
Email: cbouatmailru at gmail.com