From 813b451644686fb7e26a54005e2f7bd495a06121 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Mon, 8 Apr 2013 09:09:41 +0900 Subject: extcon: max77693: Staticize default_init_data Commit 0ec83bd246 ("extcon: max77693: Initialize register of MUIC device to bring up it without platform data") added this structure but forgot to make it static. Without this patch we get the following warning: drivers/extcon/extcon-max77693.c:41:26: warning: symbol 'default_init_data' was not declared. Should it be static? Signed-off-by: Sachin Kamat Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- drivers/extcon/extcon-max77693.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 8f3c947b002..7b2e93d4f60 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c @@ -38,7 +38,7 @@ * extcon-max77693 driver use 'default_init_data' to bring up base operation * of MAX77693 MUIC device. */ -struct max77693_reg_data default_init_data[] = { +static struct max77693_reg_data default_init_data[] = { { /* STATUS2 - [3]ChgDetRun */ .addr = MAX77693_MUIC_REG_STATUS2, -- cgit v1.2.3-18-g5258 From 6ed28105c07e0e03bf5f5a99380b726fc4de6e93 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 8 Apr 2013 09:11:06 +0900 Subject: extcon: max8997: use dev_err() instead of pr_err() dev_err() is more preferred than pr_err(). Signed-off-by: Jingoo Han Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- drivers/extcon/extcon-max8997.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 69641bcae32..20772ad4adc 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -646,7 +646,7 @@ static void max8997_muic_detect_cable_wq(struct work_struct *work) ret = max8997_muic_detect_dev(info); if (ret < 0) - pr_err("failed to detect cable type\n"); + dev_err(info->dev, "failed to detect cable type\n"); } static int max8997_muic_probe(struct platform_device *pdev) -- cgit v1.2.3-18-g5258 From c2536543d53be247786b8beb7c505c629fd55813 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Mon, 8 Apr 2013 09:12:32 +0900 Subject: extcon: max77693: Fix return value 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 Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- drivers/extcon/extcon-max77693.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 7b2e93d4f60..b56bdaa27d4 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, -- cgit v1.2.3-18-g5258 From 3ad9e86d54ed2770aa693a90a0872cbe7ffc6831 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Mon, 8 Apr 2013 09:13:18 +0900 Subject: extcon: max8997: Fix return value 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 Signed-off-by: Chanwoo Choi Signed-off-by: Myungjoo Ham --- drivers/extcon/extcon-max8997.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 20772ad4adc..67d6738d85a 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, -- cgit v1.2.3-18-g5258