public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] extcon: max77693: Fix return value
@ 2013-03-28  6:27 Sachin Kamat
  2013-03-28  6:27 ` [PATCH v2 2/2] extcon: max8997: " Sachin Kamat
  2013-03-28 23:53 ` [PATCH v2 1/2] extcon: max77693: " Chanwoo Choi
  0 siblings, 2 replies; 3+ messages in thread
From: Sachin Kamat @ 2013-03-28  6:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: myungjoo.ham, cw00.choi, sachin.kamat, patches

Return the value obtained from the function instead of hardcoding.
Silences the following warnings:
drivers/extcon/extcon-max77693.c:297 max77693_muic_set_path()
info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?
drivers/extcon/extcon-max77693.c:310 max77693_muic_set_path()
info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
Changes since v1:
Include additional instances.
Compile tested.
---
 drivers/extcon/extcon-max77693.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 8f3c947..924db01 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -258,7 +258,7 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
 					  CONTROL3_ADCDBSET_MASK);
 		if (ret) {
 			dev_err(info->dev, "failed to set ADC debounce time\n");
-			return -EAGAIN;
+			return ret;
 		}
 		break;
 	default:
@@ -294,7 +294,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
 			MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK);
 	if (ret < 0) {
 		dev_err(info->dev, "failed to update MUIC register\n");
-		return -EAGAIN;
+		return ret;
 	}
 
 	if (attached)
@@ -307,7 +307,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
 			CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
 	if (ret < 0) {
 		dev_err(info->dev, "failed to update MUIC register\n");
-		return -EAGAIN;
+		return ret;
 	}
 
 	dev_info(info->dev,
@@ -1035,7 +1035,7 @@ static int max77693_muic_detect_accessory(struct max77693_muic_info *info)
 	if (ret) {
 		dev_err(info->dev, "failed to read MUIC register\n");
 		mutex_unlock(&info->mutex);
-		return -EINVAL;
+		return ret;
 	}
 
 	adc = max77693_muic_get_cable_type(info, MAX77693_CABLE_GROUP_ADC,
-- 
1.7.4.1


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

* [PATCH v2 2/2] extcon: max8997: Fix return value
  2013-03-28  6:27 [PATCH v2 1/2] extcon: max77693: Fix return value Sachin Kamat
@ 2013-03-28  6:27 ` Sachin Kamat
  2013-03-28 23:53 ` [PATCH v2 1/2] extcon: max77693: " Chanwoo Choi
  1 sibling, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2013-03-28  6:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: myungjoo.ham, cw00.choi, sachin.kamat, patches

Return the value obtained from the function instead of hardcoding.
Fixes the following warnings:
drivers/extcon/extcon-max8997.c:235 max8997_muic_set_path() info:
why not propagate 'ret' from max8997_update_reg() instead of (-11)?
drivers/extcon/extcon-max8997.c:248 max8997_muic_set_path() info:
why not propagate 'ret' from max8997_update_reg() instead of (-11)?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/extcon/extcon-max8997.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 69641bc..3c593e8 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -196,7 +196,7 @@ static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
 					  CONTROL3_ADCDBSET_MASK);
 		if (ret) {
 			dev_err(info->dev, "failed to set ADC debounce time\n");
-			return -EAGAIN;
+			return ret;
 		}
 		break;
 	default:
@@ -232,7 +232,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
 			MAX8997_MUIC_REG_CONTROL1, ctrl1, COMP_SW_MASK);
 	if (ret < 0) {
 		dev_err(info->dev, "failed to update MUIC register\n");
-		return -EAGAIN;
+		return ret;
 	}
 
 	if (attached)
@@ -245,7 +245,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
 			CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
 	if (ret < 0) {
 		dev_err(info->dev, "failed to update MUIC register\n");
-		return -EAGAIN;
+		return ret;
 	}
 
 	dev_info(info->dev,
@@ -397,7 +397,7 @@ static int max8997_muic_handle_jig_uart(struct max8997_muic_info *info,
 	ret = max8997_muic_set_path(info, info->path_uart, attached);
 	if (ret) {
 		dev_err(info->dev, "failed to update muic register\n");
-		return -EINVAL;
+		return ret;
 	}
 
 	extcon_set_cable_state(info->edev, "JIG", attached);
@@ -608,7 +608,7 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info)
 	if (ret) {
 		dev_err(info->dev, "failed to read MUIC register\n");
 		mutex_unlock(&info->mutex);
-		return -EINVAL;
+		return ret;
 	}
 
 	adc = max8997_muic_get_cable_type(info, MAX8997_CABLE_GROUP_ADC,
-- 
1.7.4.1


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

* Re: [PATCH v2 1/2] extcon: max77693: Fix return value
  2013-03-28  6:27 [PATCH v2 1/2] extcon: max77693: Fix return value Sachin Kamat
  2013-03-28  6:27 ` [PATCH v2 2/2] extcon: max8997: " Sachin Kamat
@ 2013-03-28 23:53 ` Chanwoo Choi
  1 sibling, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2013-03-28 23:53 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, myungjoo.ham, patches

On 03/28/2013 03:27 PM, Sachin Kamat wrote:
> Return the value obtained from the function instead of hardcoding.
> Silences the following warnings:
> drivers/extcon/extcon-max77693.c:297 max77693_muic_set_path()
> info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?
> drivers/extcon/extcon-max77693.c:310 max77693_muic_set_path()
> info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> Changes since v1:
> Include additional instances.
> Compile tested.
> ---
>  drivers/extcon/extcon-max77693.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
Applied this patchset. Thanks.

Chanwoo Choi

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

end of thread, other threads:[~2013-03-28 23:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28  6:27 [PATCH v2 1/2] extcon: max77693: Fix return value Sachin Kamat
2013-03-28  6:27 ` [PATCH v2 2/2] extcon: max8997: " Sachin Kamat
2013-03-28 23:53 ` [PATCH v2 1/2] extcon: max77693: " Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox