usb: chipidea: Use dev_err() instead of pr_err()
Subsystems (2)
PATCH v2 1/1 usb: chipidea: Use dev_err() instead of pr_err()
dev_err() is more appropriate for printing error messages inside drivers, so switch to dev_err().
While at it also add the missing newlines and remove 'device' string as the ci_role(ci)->name string will tell if it is host or gadget.
---
Changes since v1:
- Add missing newlines (Johan)
- Remove 'device' string
drivers/usb/chipidea/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/chipidea/core.c +3 -2
@@ -523,8 +523,9 @@ int hw_device_reset(struct ci_hdrc *ci)hw_write (ci,OP_USBMODE ,USBMODE_SLOM ,USBMODE_SLOM );if (hw_read (ci,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) { -pr_err ("cannot enter in %s device mode" ,ci_role (ci)->name); -pr_err ("lpm = %i" , ci->hw_bank.lpm); +dev_err (ci->dev,"cannot enter in %s mode\n" , +ci_role (ci)->name); +dev_err (ci->dev,"lpm = %i\n" , ci->hw_bank.lpm);return -ENODEV ; }
Signature · 1 line
2.17.1
Greg KH
maintainerQuoted 21 lines · Fabio Estevam
dev_err()is more appropriate for printing error messages inside drivers, so switch todev_err().While at it also add the missing newlines and remove 'device' string as the ci_role(ci)->name string will tell if it is host or gadget.
Signed-off-by Fabio Estevam <[email protected]>---
Changes since v1:
- Add missing newlines (Johan)
- Remove 'device' stringdrivers/usb/chipidea/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/usb/chipidea/core.c +0
-0
drivers/usb/chipidea/core.c int hw_device_reset(struct ci_hdrc *ci) · line 526
Quoted 6 lines
drivers/usb/chipidea/core.c +1
-2@@ -523,8 +523,9 @@ int hw_device_reset(struct ci_hdrc *ci)hw_write (ci,OP_USBMODE ,USBMODE_SLOM ,USBMODE_SLOM );if (hw_read (ci,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) { -pr_err ("cannot enter in %s device mode" ,ci_role (ci)->name); -pr_err ("lpm = %i" , ci->hw_bank.lpm); + dev_err(ci->dev, "cannot enter in %s mode\n",
You changed the string text, why?
thanks,
greg k-h
Hi Greg,
Quoted 7 lines · Greg KH
Quoted 7 lines
drivers/usb/chipidea/core.c +0
-0@@ -523,8 +523,9 @@ int hw_device_reset(struct ci_hdrc *ci)hw_write (ci,OP_USBMODE ,USBMODE_SLOM ,USBMODE_SLOM );
Quoted 6 lines
drivers/usb/chipidea/core.c int hw_device_reset(struct ci_hdrc *ci) · line 526
Quoted 4 lines
drivers/usb/chipidea/core.c +1
-2if (hw_read (ci,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) { -pr_err ("cannot enter in %s device mode" ,ci_role (ci)->name); -pr_err ("lpm = %i" , ci->hw_bank.lpm); + dev_err(ci->dev, "cannot enter in %s mode\n",You changed the string text, why?
I mentioned this string change in the commit log.
Originally we could have the following error message:
cannot enter in host device mode
This "host device" message looks strange, so that's why I removed the "device" string.
If you prefer, I can split it in three patches (add newline, remove 'device' string, change to dev_err).
Thanks
Greg KH
maintainerQuoted 18 lines · Fabio Estevam
Hi Greg,
Quoted 7 lines · Greg KH
Quoted 7 lines
drivers/usb/chipidea/core.c +0
-0@@ -523,8 +523,9 @@ int hw_device_reset(struct ci_hdrc *ci)hw_write (ci,OP_USBMODE ,USBMODE_SLOM ,USBMODE_SLOM );Quoted 6 lines
drivers/usb/chipidea/core.c int hw_device_reset(struct ci_hdrc *ci) · line 526
Quoted 4 lines
drivers/usb/chipidea/core.c +1
-2if (hw_read (ci,OP_USBMODE ,USBMODE_CM ) !=USBMODE_CM_DC ) { -pr_err ("cannot enter in %s device mode" ,ci_role (ci)->name); -pr_err ("lpm = %i" , ci->hw_bank.lpm); + dev_err(ci->dev, "cannot enter in %s mode\n",You changed the string text, why?
Quoted 8 lines
I mentioned this string change in the commit log.
Originally we could have the following error message:
cannot enter in host device mode
This "host device" message looks strange, so that's why I removed the "device" string.
Why is it strange? Please just leave it as-is unless you know this change is ok.
Quoted 2 lines
If you prefer, I can split it in three patches (add newline, remove 'device' string, change to
dev_err).
No, just one is fine, to dev_err(), but do not change the string.
thanks,
greg k-h