Skip to contentSkip to conversation

Power: ab8500: Fixed coding style issues and made array const

PATCH New Jesper Falk 1 participant 1 message Jan 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Power: ab8500: Fixed coding style issues and made array const

Fixed coding style.

Made some arrays constant on request.

---
 drivers/power/Module.symvers   |   0
 drivers/power/ab8500_bmdata.c  | 122 ++++++++++++++++++++---------------------
 drivers/power/ab8500_btemp.c   |   8 +--
 drivers/power/ab8500_charger.c |  10 ++--
 drivers/power/ab8500_fg.c      |  38 ++++++++-----
 5 files changed, 92 insertions(+), 86 deletions(-)
 create mode 100644 drivers/power/Module.symvers
drivers/power/Module.symvers new file +0 -0
new file mode 100644
index 0000000..e69de29
drivers/power/ab8500_bmdata.c +61 -61

153 lines not on this page · raw message

drivers/power/ab8500_btemp.c +3 -5
index 7f9a454..6ef7d92 100644
@@ -84,7 +84,7 @@ struct ab8500_btemp_ranges {
  * @parent:		Pointer to the struct ab8500
  * @gpadc:		Pointer to the struct gpadc
  * @fg:			Pointer to the struct fg
- * @bm:           	Platform specific battery management information
+ * @bm:			Platform specific battery management information
  * @btemp_psy:		Structure for BTEMP specific battery properties
  * @events:		Structure for information about events triggered
  * @btemp_ranges:	Battery temperature range structure
@@ -946,9 +946,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
 			switch (ext->type) {
 			case POWER_SUPPLY_TYPE_MAINS:
 				/* AC disconnected */
-				if (!ret.intval && di->events.ac_conn) {
+				if (!ret.intval && di->events.ac_conn)
 					di->events.ac_conn = false;
-				}
 				/* AC connected */
 				else if (ret.intval && !di->events.ac_conn) {
 					di->events.ac_conn = true;
@@ -958,9 +957,8 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
 				break;
 			case POWER_SUPPLY_TYPE_USB:
 				/* USB disconnected */
-				if (!ret.intval && di->events.usb_conn) {
+				if (!ret.intval && di->events.usb_conn)
 					di->events.usb_conn = false;
-				}
 				/* USB connected */
 				else if (ret.intval && !di->events.usb_conn) {
 					di->events.usb_conn = true;
drivers/power/ab8500_charger.c +4 -6
index 19110aa..481e304 100644
@@ -236,7 +236,7 @@ struct ab8500_charger_max_usb_in_curr {
  *			Counter for current stepping sessions
  * @parent:		Pointer to the struct ab8500
  * @gpadc:		Pointer to the struct gpadc
- * @bm:           	Platform specific battery management information
+ * @bm:			Platform specific battery management information
  * @flags:		Structure for information about events triggered
  * @usb_state:		Structure for usb stack information
  * @max_usb_in_curr:	Max USB charger input current
@@ -385,17 +385,15 @@ static void ab8500_enable_disable_sw_fallback(struct ab8500_charger *di,
 
 	/* write back the changed fallback bit value to register */
 	ret = abx500_set_register_interruptible(di->dev, bank, reg, val);
-	if (ret) {
+	if (ret)
 		dev_err(di->dev, "%d write failed\n", __LINE__);
-	}
 
 disable_otp:
 	if (is_ab8500(di->parent)) {
 		/* disable the set OTP registers again */
 		ret = abx500_set_register_interruptible(di->dev, 0x11, 0x00, 0x0);
-		if (ret) {
+		if (ret)
 			dev_err(di->dev, "%d write failed\n", __LINE__);
-		}
 	}
 }
 
@@ -2397,7 +2395,7 @@ static void ab8500_charger_usb_link_status_work(struct work_struct *work)
 		return;
 	}
 
-	dev_dbg(di->dev,"%s di->vbus_detected = true\n",__func__);
+	dev_dbg(di->dev, "%s di->vbus_detected = true\n", __func__);
 	di->vbus_detected = true;
 	ret = ab8500_charger_read_usb_type(di);
 	if (ret) {
drivers/power/ab8500_fg.c +24 -14
index 3cb4178..13d6903 100644
@@ -185,7 +185,7 @@ struct inst_curr_result_list {
  * @avg_cap:		Average capacity filter
  * @parent:		Pointer to the struct ab8500
  * @gpadc:		Pointer to the struct gpadc
- * @bm:           	Platform specific battery management information
+ * @bm:			Platform specific battery management information
  * @fg_psy:		Structure that holds the FG specific battery properties
  * @fg_wq:		Work queue for running the FG algorithm
  * @fg_periodic_work:	Work to run the FG algorithm periodically
@@ -821,7 +821,8 @@ static void ab8500_fg_acc_cur_work(struct work_struct *work)
 	queue_work(di->fg_wq, &di->fg_work);
 
 	dev_dbg(di->dev, "fg_res: %d, fg_samples: %d, gasg: %d, accu_charge: %d \n",
-				di->bm->fg_res, di->fg_samples, val, di->accu_charge);
+				di->bm->fg_res, di->fg_samples, val,
+				di->accu_charge);
 	return;
 exit:
 	dev_err(di->dev,
@@ -1884,9 +1885,9 @@ static void ab8500_fg_low_bat_work(struct work_struct *work)
 			dev_warn(di->dev, "Shut down pending...\n");
 		} else {
 			/*
-			* Else we need to re-schedule this check to be able to detect
-			* if the voltage increases again during charging or
-			* due to decreasing load.
+			* Else we need to re-schedule this check to be able to
+			* detect if the voltage increases again during charging
+			* or due to decreasing load.
 			*/
 			di->low_bat_cnt--;
 			dev_warn(di->dev, "Battery voltage still LOW\n");
@@ -2735,7 +2736,8 @@ static ssize_t ab8505_powercut_restart_write(struct device *dev,
 	}
 
 	ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_RESTART_REG, (u8)reg_value);
+						AB8505_RTC_PCUT_RESTART_REG,
+						(u8)reg_value);
 
 	if (ret < 0)
 		dev_err(dev, "Failed to set AB8505_RTC_PCUT_RESTART_REG\n");
@@ -2757,7 +2759,8 @@ static ssize_t ab8505_powercut_timer_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_TIME_REG, &reg_value);
+						AB8505_RTC_PCUT_TIME_REG,
+						&reg_value);
 
 	if (ret < 0) {
 		dev_err(dev, "Failed to read AB8505_RTC_PCUT_TIME_REG\n");
@@ -2782,7 +2785,8 @@ static ssize_t ab8505_powercut_restart_counter_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_RESTART_REG, &reg_value);
+						AB8505_RTC_PCUT_RESTART_REG,
+						&reg_value);
 
 	if (ret < 0) {
 		dev_err(dev, "Failed to read AB8505_RTC_PCUT_RESTART_REG\n");
@@ -2807,7 +2811,8 @@ static ssize_t ab8505_powercut_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_CTL_STATUS_REG, &reg_value);
+						AB8505_RTC_PCUT_CTL_STATUS_REG,
+						&reg_value);
 
 	if (ret < 0)
 		goto fail;
@@ -2836,7 +2841,8 @@ static ssize_t ab8505_powercut_write(struct device *dev,
 	}
 
 	ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_CTL_STATUS_REG, (u8)reg_value);
+						AB8505_RTC_PCUT_CTL_STATUS_REG,
+						(u8)reg_value);
 
 	if (ret < 0)
 		dev_err(dev, "Failed to set AB8505_RTC_PCUT_CTL_STATUS_REG\n");
@@ -2858,7 +2864,8 @@ static ssize_t ab8505_powercut_flag_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_CTL_STATUS_REG,  &reg_value);
+						AB8505_RTC_PCUT_CTL_STATUS_REG,
+						&reg_value);
 
 	if (ret < 0) {
 		dev_err(dev, "Failed to read AB8505_RTC_PCUT_CTL_STATUS_REG\n");
@@ -2883,7 +2890,8 @@ static ssize_t ab8505_powercut_debounce_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_DEBOUNCE_REG,  &reg_value);
+						AB8505_RTC_PCUT_DEBOUNCE_REG,
+						&reg_value);
 
 	if (ret < 0) {
 		dev_err(dev, "Failed to read AB8505_RTC_PCUT_DEBOUNCE_REG\n");
@@ -2914,7 +2922,8 @@ static ssize_t ab8505_powercut_debounce_write(struct device *dev,
 	}
 
 	ret = abx500_set_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_DEBOUNCE_REG, (u8)reg_value);
+						AB8505_RTC_PCUT_DEBOUNCE_REG,
+						(u8)reg_value);
 
 	if (ret < 0)
 		dev_err(dev, "Failed to set AB8505_RTC_PCUT_DEBOUNCE_REG\n");
@@ -2935,7 +2944,8 @@ static ssize_t ab8505_powercut_enable_status_read(struct device *dev,
 	di = to_ab8500_fg_device_info(psy);
 
 	ret = abx500_get_register_interruptible(di->dev, AB8500_RTC,
-						AB8505_RTC_PCUT_CTL_STATUS_REG, &reg_value);
+						AB8505_RTC_PCUT_CTL_STATUS_REG,
+						&reg_value);
 
 	if (ret < 0) {
 		dev_err(dev, "Failed to read AB8505_RTC_PCUT_CTL_STATUS_REG\n");
Signature · 1 line
1.8.5.2