Skip to contentSkip to conversation

power_supply: Remove broken mark for da9052-battery

PATCH Applied Axel Lin 2 participants 2 messages Aug 8, 2012 – Aug 23, 2012

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 power_supply: Remove broken mark for da9052-battery

The fix for MFD part is already merged so we can remove the broken mark for da9052-battery.

---
 drivers/power/Kconfig |    1 -
 1 file changed, 1 deletion(-)
drivers/power/Kconfig +0 -1
index c1892f3..fcc1bb0 100644
@@ -167,7 +167,6 @@ config BATTERY_DA9030
 config BATTERY_DA9052
 	tristate "Dialog DA9052 Battery"
 	depends on PMIC_DA9052
-	depends on BROKEN
 	help
 	  Say Y here to enable support for batteries charger integrated into
 	  DA9052 PMIC.
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 5 lines · Axel Lin

The fix for MFD part is already merged so we can remove the broken mark for da9052-battery.

---

[...]

Review

Quoted 1 line
(quoted diff) +0 -1
-	depends on BROKEN

Applied, thanks a lot!

Though, I had to apply the following right after:

commit bc909f27f55ceb8f950ced5cf3a26d6b26e86ca6

Author: Anton Vorontsov <[email protected]>
Date:   Wed Aug 22 19:29:44 2012 -0700

da9052-battery: Fix da9052_determine_vc_tbl_index's return value

The patch fixes the following warnings:

CHECK drivers/power/da9052-battery.c
drivers/power/da9052-battery.c:330:15: warning: symbol 'da9052_determine_vc_tbl_index' was not declared. Should it be static?
CC drivers/power/da9052-battery.o
drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index':
drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type]

drivers/power/da9052-battery.c +8 -1
index a5f6a0e..20b86ed 100644
@@ -327,7 +327,7 @@ static int da9052_bat_interpolate(int vbat_lower, int  vbat_upper,
 	return tmp;
 }
 
-unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
+static unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
 {
 	int i;
 
@@ -345,6 +345,13 @@ unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
 		     && (adc_temp <= vc_tbl_ref[i]))
 				return i + 1;
 	}
+	/*
+	 * For some reason authors of the driver didn't presume that we can
+	 * end up here. It might be OK, but might be not, no one knows for
+	 * sure. Go check your battery, is it on fire?
+	 */
+	WARN_ON(1);
+	return 0;
 }
 
 static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity)