* [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err()
@ 2019-06-05 13:07 Fabio Estevam
2019-06-05 14:21 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2019-06-05 13:07 UTC (permalink / raw)
To: Peter.Chen; +Cc: gregkh, johan, linux-usb, Fabio Estevam
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.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- Add missing newlines (Johan)
- Remove 'device' string
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..92132b35b7fd 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 mode\n",
+ ci_role(ci)->name);
+ dev_err(ci->dev, "lpm = %i\n", ci->hw_bank.lpm);
return -ENODEV;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err()
2019-06-05 13:07 [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err() Fabio Estevam
@ 2019-06-05 14:21 ` Greg KH
2019-06-05 14:47 ` Fabio Estevam
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2019-06-05 14:21 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Peter.Chen, johan, linux-usb
On Wed, Jun 05, 2019 at 10:07:23AM -0300, Fabio Estevam wrote:
> 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.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
> Changes since v1:
> - Add missing newlines (Johan)
> - Remove 'device' string
>
> 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..92132b35b7fd 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 mode\n",
You changed the string text, why?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err()
2019-06-05 14:21 ` Greg KH
@ 2019-06-05 14:47 ` Fabio Estevam
2019-06-05 15:42 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2019-06-05 14:47 UTC (permalink / raw)
To: Greg KH; +Cc: Peter Chen, Johan Hovold, USB list
Hi Greg,
On Wed, Jun 5, 2019 at 11:21 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > index 27749ace2d93..92132b35b7fd 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 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err()
2019-06-05 14:47 ` Fabio Estevam
@ 2019-06-05 15:42 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2019-06-05 15:42 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Peter Chen, Johan Hovold, USB list
On Wed, Jun 05, 2019 at 11:47:59AM -0300, Fabio Estevam wrote:
> Hi Greg,
>
> On Wed, Jun 5, 2019 at 11:21 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> > > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> > > index 27749ace2d93..92132b35b7fd 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 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.
Why is it strange? Please just leave it as-is unless you know this
change is ok.
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-05 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 13:07 [PATCH v2] usb: chipidea: Use dev_err() instead of pr_err() Fabio Estevam
2019-06-05 14:21 ` Greg KH
2019-06-05 14:47 ` Fabio Estevam
2019-06-05 15:42 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).