All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ab8500: remove explicit handling of battery type
@ 2012-12-03 18:12 ` Rajanikanth H.V
  0 siblings, 0 replies; 8+ messages in thread
From: Rajanikanth H.V @ 2012-12-03 18:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>

dt property, 'battery-type' shall be one of supported technology type
instead blank.
refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
      for the list of supported types

thanks to Francesco Lavra for highlighting missing of_node_put(...)

for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
 drivers/power/ab8500_bmdata.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528..2230b2c 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev,
 	struct  device_node *np_bat_supply;
 	struct	abx500_bm_data *bat;
 	const char *btech;
-	char bat_tech[8];
 	int i, thermistor;
 
 	*battery = &ab8500_bm_data;
@@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev,
 		"stericsson,battery-type", NULL);
 	if (!btech) {
 		dev_warn(dev, "missing property battery-name/type\n");
-		strcpy(bat_tech, "UNKNOWN");
-	} else {
-		strcpy(bat_tech, btech);
+		of_node_put(np_bat_supply);
+		return -EINVAL;
 	}
-
-	if (strncmp(bat_tech, "LION", 4) == 0) {
+	if (strncmp(btech, "LION", 4) == 0) {
 		bat->no_maintenance  = true;
 		bat->chg_unknown_bat = true;
 		bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
@@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev,
 		if (thermistor == NTC_EXTERNAL) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_ext_thermistor;
-		} else if (strncmp(bat_tech, "LION", 4) == 0) {
+		} else if (strncmp(btech, "LION", 4) == 0) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_9100;
 		} else {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ab8500: remove explicit handling of battery type
@ 2012-12-03 18:12 ` Rajanikanth H.V
  0 siblings, 0 replies; 8+ messages in thread
From: Rajanikanth H.V @ 2012-12-03 18:12 UTC (permalink / raw)
  To: anton.vorontsov
  Cc: francescolavra.fl, rob.herring, lee.jones, arnd, linus.walleij,
	linux-arm-kernel, linux-kernel, linaro-dev, patches,
	STEricsson_nomadik_linux, rajanikanth.hv

From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>

dt property, 'battery-type' shall be one of supported technology type
instead blank.
refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
      for the list of supported types

thanks to Francesco Lavra for highlighting missing of_node_put(...)

for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
 drivers/power/ab8500_bmdata.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528..2230b2c 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev,
 	struct  device_node *np_bat_supply;
 	struct	abx500_bm_data *bat;
 	const char *btech;
-	char bat_tech[8];
 	int i, thermistor;
 
 	*battery = &ab8500_bm_data;
@@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev,
 		"stericsson,battery-type", NULL);
 	if (!btech) {
 		dev_warn(dev, "missing property battery-name/type\n");
-		strcpy(bat_tech, "UNKNOWN");
-	} else {
-		strcpy(bat_tech, btech);
+		of_node_put(np_bat_supply);
+		return -EINVAL;
 	}
-
-	if (strncmp(bat_tech, "LION", 4) == 0) {
+	if (strncmp(btech, "LION", 4) == 0) {
 		bat->no_maintenance  = true;
 		bat->chg_unknown_bat = true;
 		bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
@@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev,
 		if (thermistor == NTC_EXTERNAL) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_ext_thermistor;
-		} else if (strncmp(bat_tech, "LION", 4) == 0) {
+		} else if (strncmp(btech, "LION", 4) == 0) {
 			btype->batres_tbl =
 				temp_to_batres_tbl_9100;
 		} else {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ab8500: promote ab8500_fg probe before ab8500_btemp probe
  2012-12-03 18:12 ` Rajanikanth H.V
@ 2012-12-03 18:12   ` Rajanikanth H.V
  -1 siblings, 0 replies; 8+ messages in thread
From: Rajanikanth H.V @ 2012-12-03 18:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>

ab8500_fg driver prepares instance list of fuelgauge which is
required by btemp driver for battery identification. So make sure
that ab8500 fuelgauge list is ready before btemp driver starts.

for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
 drivers/power/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 696e3a9..070c73d 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
 obj-$(CONFIG_BATTERY_JZ4740)	+= jz4740-battery.o
 obj-$(CONFIG_BATTERY_INTEL_MID)	+= intel_mid_battery.o
 obj-$(CONFIG_BATTERY_RX51)	+= rx51_battery.o
-obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
+obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o
 obj-$(CONFIG_CHARGER_ISP1704)	+= isp1704_charger.o
 obj-$(CONFIG_CHARGER_MAX8903)	+= max8903_charger.o
 obj-$(CONFIG_CHARGER_TWL4030)	+= twl4030_charger.o
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ab8500: promote ab8500_fg probe before ab8500_btemp probe
@ 2012-12-03 18:12   ` Rajanikanth H.V
  0 siblings, 0 replies; 8+ messages in thread
From: Rajanikanth H.V @ 2012-12-03 18:12 UTC (permalink / raw)
  To: anton.vorontsov
  Cc: francescolavra.fl, rob.herring, lee.jones, arnd, linus.walleij,
	linux-arm-kernel, linux-kernel, linaro-dev, patches,
	STEricsson_nomadik_linux, rajanikanth.hv

From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>

ab8500_fg driver prepares instance list of fuelgauge which is
required by btemp driver for battery identification. So make sure
that ab8500 fuelgauge list is ready before btemp driver starts.

for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
---
 drivers/power/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 696e3a9..070c73d 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
 obj-$(CONFIG_BATTERY_JZ4740)	+= jz4740-battery.o
 obj-$(CONFIG_BATTERY_INTEL_MID)	+= intel_mid_battery.o
 obj-$(CONFIG_BATTERY_RX51)	+= rx51_battery.o
-obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
+obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o
 obj-$(CONFIG_CHARGER_ISP1704)	+= isp1704_charger.o
 obj-$(CONFIG_CHARGER_MAX8903)	+= max8903_charger.o
 obj-$(CONFIG_CHARGER_TWL4030)	+= twl4030_charger.o
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ab8500: remove explicit handling of battery type
  2012-12-03 18:12 ` Rajanikanth H.V
@ 2012-12-04  8:56   ` Lee Jones
  -1 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2012-12-04  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

> From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
> 
> dt property, 'battery-type' shall be one of supported technology type
> instead blank.
> refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
>       for the list of supported types
> 
> thanks to Francesco Lavra for highlighting missing of_node_put(...)
> 
> for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Uppercase 'DT'. 
No need for the comma after 'property'.
No real need to reference to the documentation.
No need to add personal thanks to a commit message.
No need to mention the patch's intended route in the commit message.

How about something more like:

Subject: ab8500: Remove initial "UNKNOWN" battery-type string assignment

DT property 'stericsson,battery-type' should always be present in the
Device Tree when describing battery hardware. Thus, instead of
pointlessly assigning "UNKNOWN" as a valid battery-type, we should
actually fail initialisation entirely if the property is missing.

> Acked-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
> ---
>  drivers/power/ab8500_bmdata.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
> index 03cc528..2230b2c 100644
> --- a/drivers/power/ab8500_bmdata.c
> +++ b/drivers/power/ab8500_bmdata.c
> @@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev,
>  	struct  device_node *np_bat_supply;
>  	struct	abx500_bm_data *bat;
>  	const char *btech;
> -	char bat_tech[8];
>  	int i, thermistor;
>  
>  	*battery = &ab8500_bm_data;
> @@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev,
>  		"stericsson,battery-type", NULL);
>  	if (!btech) {
>  		dev_warn(dev, "missing property battery-name/type\n");
> -		strcpy(bat_tech, "UNKNOWN");
> -	} else {
> -		strcpy(bat_tech, btech);
> +		of_node_put(np_bat_supply);
> +		return -EINVAL;
>  	}
> -
> -	if (strncmp(bat_tech, "LION", 4) == 0) {
> +	if (strncmp(btech, "LION", 4) == 0) {
>  		bat->no_maintenance  = true;
>  		bat->chg_unknown_bat = true;
>  		bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
> @@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev,
>  		if (thermistor == NTC_EXTERNAL) {
>  			btype->batres_tbl =
>  				temp_to_batres_tbl_ext_thermistor;
> -		} else if (strncmp(bat_tech, "LION", 4) == 0) {
> +		} else if (strncmp(btech, "LION", 4) == 0) {
>  			btype->batres_tbl =
>  				temp_to_batres_tbl_9100;
>  		} else {
> -- 
> 1.7.10.4
> 

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ab8500: remove explicit handling of battery type
@ 2012-12-04  8:56   ` Lee Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2012-12-04  8:56 UTC (permalink / raw)
  To: Rajanikanth H.V
  Cc: anton.vorontsov, francescolavra.fl, rob.herring, arnd,
	linus.walleij, linux-arm-kernel, linux-kernel, linaro-dev,
	patches, STEricsson_nomadik_linux, rajanikanth.hv

> From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
> 
> dt property, 'battery-type' shall be one of supported technology type
> instead blank.
> refer:Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
>       for the list of supported types
> 
> thanks to Francesco Lavra for highlighting missing of_node_put(...)
> 
> for '3.7-rc5': of git://git.infradead.org/battery-2.6.git

Uppercase 'DT'. 
No need for the comma after 'property'.
No real need to reference to the documentation.
No need to add personal thanks to a commit message.
No need to mention the patch's intended route in the commit message.

How about something more like:

Subject: ab8500: Remove initial "UNKNOWN" battery-type string assignment

DT property 'stericsson,battery-type' should always be present in the
Device Tree when describing battery hardware. Thus, instead of
pointlessly assigning "UNKNOWN" as a valid battery-type, we should
actually fail initialisation entirely if the property is missing.

> Acked-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
> ---
>  drivers/power/ab8500_bmdata.c |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
> index 03cc528..2230b2c 100644
> --- a/drivers/power/ab8500_bmdata.c
> +++ b/drivers/power/ab8500_bmdata.c
> @@ -461,7 +461,6 @@ bmdevs_of_probe(struct device *dev,
>  	struct  device_node *np_bat_supply;
>  	struct	abx500_bm_data *bat;
>  	const char *btech;
> -	char bat_tech[8];
>  	int i, thermistor;
>  
>  	*battery = &ab8500_bm_data;
> @@ -488,12 +487,10 @@ bmdevs_of_probe(struct device *dev,
>  		"stericsson,battery-type", NULL);
>  	if (!btech) {
>  		dev_warn(dev, "missing property battery-name/type\n");
> -		strcpy(bat_tech, "UNKNOWN");
> -	} else {
> -		strcpy(bat_tech, btech);
> +		of_node_put(np_bat_supply);
> +		return -EINVAL;
>  	}
> -
> -	if (strncmp(bat_tech, "LION", 4) == 0) {
> +	if (strncmp(btech, "LION", 4) == 0) {
>  		bat->no_maintenance  = true;
>  		bat->chg_unknown_bat = true;
>  		bat->bat_type[BATTERY_UNKNOWN].charge_full_design = 2600;
> @@ -508,7 +505,7 @@ bmdevs_of_probe(struct device *dev,
>  		if (thermistor == NTC_EXTERNAL) {
>  			btype->batres_tbl =
>  				temp_to_batres_tbl_ext_thermistor;
> -		} else if (strncmp(bat_tech, "LION", 4) == 0) {
> +		} else if (strncmp(btech, "LION", 4) == 0) {
>  			btype->batres_tbl =
>  				temp_to_batres_tbl_9100;
>  		} else {
> -- 
> 1.7.10.4
> 

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ab8500: promote ab8500_fg probe before ab8500_btemp probe
  2012-12-03 18:12   ` Rajanikanth H.V
@ 2013-01-06  1:40     ` Anton Vorontsov
  -1 siblings, 0 replies; 8+ messages in thread
From: Anton Vorontsov @ 2013-01-06  1:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 03, 2012 at 11:42:55PM +0530, Rajanikanth H.V wrote:
> From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
> 
> ab8500_fg driver prepares instance list of fuelgauge which is
> required by btemp driver for battery identification. So make sure
> that ab8500 fuelgauge list is ready before btemp driver starts.
> 
> for '3.7-rc5': of git://git.infradead.org/battery-2.6.git
> 
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
> ---

This one, and "1/2 v2" applied, thanks!

>  drivers/power/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/Makefile b/drivers/power/Makefile
> index 696e3a9..070c73d 100644
> --- a/drivers/power/Makefile
> +++ b/drivers/power/Makefile
> @@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
>  obj-$(CONFIG_BATTERY_JZ4740)	+= jz4740-battery.o
>  obj-$(CONFIG_BATTERY_INTEL_MID)	+= intel_mid_battery.o
>  obj-$(CONFIG_BATTERY_RX51)	+= rx51_battery.o
> -obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
> +obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o
>  obj-$(CONFIG_CHARGER_ISP1704)	+= isp1704_charger.o
>  obj-$(CONFIG_CHARGER_MAX8903)	+= max8903_charger.o
>  obj-$(CONFIG_CHARGER_TWL4030)	+= twl4030_charger.o
> -- 
> 1.7.10.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ab8500: promote ab8500_fg probe before ab8500_btemp probe
@ 2013-01-06  1:40     ` Anton Vorontsov
  0 siblings, 0 replies; 8+ messages in thread
From: Anton Vorontsov @ 2013-01-06  1:40 UTC (permalink / raw)
  To: Rajanikanth H.V
  Cc: francescolavra.fl, rob.herring, lee.jones, arnd, linus.walleij,
	linux-arm-kernel, linux-kernel, linaro-dev, patches,
	STEricsson_nomadik_linux, rajanikanth.hv

On Mon, Dec 03, 2012 at 11:42:55PM +0530, Rajanikanth H.V wrote:
> From: "Rajanikanth H.V" <rajanikanth.hv@stericsson.com>
> 
> ab8500_fg driver prepares instance list of fuelgauge which is
> required by btemp driver for battery identification. So make sure
> that ab8500 fuelgauge list is ready before btemp driver starts.
> 
> for '3.7-rc5': of git://git.infradead.org/battery-2.6.git
> 
> Acked-by: Lee Jones <lee.jones@linaro.org>
> Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
> ---

This one, and "1/2 v2" applied, thanks!

>  drivers/power/Makefile |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/Makefile b/drivers/power/Makefile
> index 696e3a9..070c73d 100644
> --- a/drivers/power/Makefile
> +++ b/drivers/power/Makefile
> @@ -38,7 +38,7 @@ obj-$(CONFIG_CHARGER_PCF50633)	+= pcf50633-charger.o
>  obj-$(CONFIG_BATTERY_JZ4740)	+= jz4740-battery.o
>  obj-$(CONFIG_BATTERY_INTEL_MID)	+= intel_mid_battery.o
>  obj-$(CONFIG_BATTERY_RX51)	+= rx51_battery.o
> -obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_btemp.o ab8500_fg.o abx500_chargalg.o
> +obj-$(CONFIG_AB8500_BM)		+= ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o
>  obj-$(CONFIG_CHARGER_ISP1704)	+= isp1704_charger.o
>  obj-$(CONFIG_CHARGER_MAX8903)	+= max8903_charger.o
>  obj-$(CONFIG_CHARGER_TWL4030)	+= twl4030_charger.o
> -- 
> 1.7.10.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-06  1:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 18:12 [PATCH 1/2] ab8500: remove explicit handling of battery type Rajanikanth H.V
2012-12-03 18:12 ` Rajanikanth H.V
2012-12-03 18:12 ` [PATCH 2/2] ab8500: promote ab8500_fg probe before ab8500_btemp probe Rajanikanth H.V
2012-12-03 18:12   ` Rajanikanth H.V
2013-01-06  1:40   ` Anton Vorontsov
2013-01-06  1:40     ` Anton Vorontsov
2012-12-04  8:56 ` [PATCH 1/2] ab8500: remove explicit handling of battery type Lee Jones
2012-12-04  8:56   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.