Skip to contentSkip to conversation

extcon: max8997: use dev_err() instead of pr_err()

PATCH Superseded Jingoo Han 2 participants 4 messages Mar 19, 2013 External connector subsystem (extcon)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/2 extcon: max8997: use dev_err() instead of pr_err()

dev_err() is more preferred than pr_err().

---
 drivers/extcon/extcon-max8997.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/extcon/extcon-max8997.c +1 -1
index 69641bc..20772ad 100644
@@ -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)
Signature · 1 line
1.7.2.5
author
#1 lore raw

PATCH 2/2 extcon: max8997: add missing const

Fixed the checkpatch warning as below:

WARNING: static const char * array should probably be static const char * const #163: FILE: drivers/extcon/extcon-max8997.c:163:
+static const char *max8997_extcon_cable[] = {

---
 drivers/extcon/extcon-max8997.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/extcon/extcon-max8997.c +1 -1
index 20772ad..6e8724f 100644
@@ -160,7 +160,7 @@ enum {
 	_EXTCON_CABLE_NUM,
 };
 
-static const char *max8997_extcon_cable[] = {
+static const char const *max8997_extcon_cable[] = {
 	[EXTCON_CABLE_USB]			= "USB",
 	[EXTCON_CABLE_USB_HOST]			= "USB-Host",
 	[EXTCON_CABLE_TA]			= "TA",
Signature · 1 line
1.7.2.5
#2 lore raw

Re: [PATCH 2/2] extcon: max8997: add missing const

Quoted 16 lines · Jingoo Han

Fixed the checkpatch warning as below:

WARNING: static const char * array should probably be static const char * const #163: FILE: drivers/extcon/extcon-max8997.c:163:
+static const char *max8997_extcon_cable[] = {

---
 drivers/extcon/extcon-max8997.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/extcon/extcon-max8997.c +0 -0
index 20772ad..6e8724f 100644

drivers/extcon/extcon-max8997.c enum { · line 163

Quoted 5 lines
drivers/extcon/extcon-max8997.c +1 -1
@@ -160,7 +160,7 @@ enum {
        _EXTCON_CABLE_NUM,
 };
 
-static const char *max8997_extcon_cable[] = {
+static const char const *max8997_extcon_cable[] = {

Shouldn't this be "static const char * const max8997_extcon_cable[]" as suggested by checkpatch (as mentioned in your commit log)?

Signature · 2 lines
With warm regards,
Sachin
author
#3 lore raw

Re: [PATCH 2/2] extcon: max8997: add missing const

Quoted 29 lines

-----Original Message-----
From: Sachin Kamat [mailto:[email protected]]
Sent: Tuesday, March 19, 2013 12:33 PM
To: Jingoo Han
Cc: MyungJoo Ham; Chanwoo Choi; [email protected]
Subject: Re: [PATCH 2/2] extcon: max8997: add missing const

Quoted 19 lines · Jingoo Han

Fixed the checkpatch warning as below:

WARNING: static const char * array should probably be static const char * const #163: FILE: drivers/extcon/extcon-max8997.c:163:
+static const char *max8997_extcon_cable[] = {

---
 drivers/extcon/extcon-max8997.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/extcon/extcon-max8997.c +0 -0
index 20772ad..6e8724f 100644
@@ -160,7 +160,7 @@ enum {
        _EXTCON_CABLE_NUM,
 };
 
Quoted 5 lines

drivers/extcon/extcon-max8997.c enum { · line 163

Quoted 2 lines
drivers/extcon/extcon-max8997.c +1 -1
-static const char *max8997_extcon_cable[] = {
+static const char const *max8997_extcon_cable[] = {

Shouldn't this be "static const char * const max8997_extcon_cable[]" as suggested by checkpatch (as mentioned in your commit log)?

Hi Sachin Kamat,

Although the checkpatch warning is already fixed, I will send v2 patch for clarity.

Thank you for your comment.

Best regards,
Jingoo Han

Quoted 5 lines

--
With warm regards,
Sachin