diff mbox series

usb: chipidea: Use dev_err() instead of pr_err()

Message ID 20190604020901.15197-1-festevam@gmail.com (mailing list archive)
State Superseded
Headers show
Series usb: chipidea: Use dev_err() instead of pr_err() | expand

Commit Message

Fabio Estevam June 4, 2019, 2:09 a.m. UTC
dev_err() is more appropriate for printing error messages inside
drivers, so switch to dev_err().

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/usb/chipidea/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Johan Hovold June 4, 2019, 6:03 a.m. UTC | #1
On Mon, Jun 03, 2019 at 11:09:01PM -0300, Fabio Estevam wrote:
> dev_err() is more appropriate for printing error messages inside
> drivers, so switch to dev_err().
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/usb/chipidea/core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 27749ace2d93..1b6495829265 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -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 device mode",
> +			ci_role(ci)->name);
> +		dev_err(ci->dev, "lpm = %i", ci->hw_bank.lpm);

Please also add the missing newlines '\n' (and check if there are more
instances of that mistake in this driver).

>  		return -ENODEV;
>  	}

Johan
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 27749ace2d93..1b6495829265 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -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 device mode",
+			ci_role(ci)->name);
+		dev_err(ci->dev, "lpm = %i", ci->hw_bank.lpm);
 		return -ENODEV;
 	}