From: Bartosz Bilas <b.bilas@grinn-global.com>
To: Jules Maselbas <jmaselbas@kalray.eu>, barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: Re: [PATCH v2 1/2] usb: gadget: dfu: Rework print messages
Date: Tue, 16 Feb 2021 10:19:00 +0100 [thread overview]
Message-ID: <2e8c050e-b72d-5f29-c905-8c8e1bf5e303@grinn-global.com> (raw)
In-Reply-To: <20210215141843.27629-1-jmaselbas@kalray.eu>
Hello Jules,
On 15.02.2021 15:18, Jules Maselbas wrote:
> Replace printf with pr_err and debug with pr_debug.
> Defines "dfu :" as a prefix for formatted prints.
>
> ---
> v1 -> v2:
> - add `pr_fmt(fmt) "dfu: " fmt`
> - change debug call to pr_debug
> - remove "dfu: " in print messages
>
> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
> ---
> drivers/usb/gadget/dfu.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
> index 9d6a9d252..fba4ad782 100644
> --- a/drivers/usb/gadget/dfu.c
> +++ b/drivers/usb/gadget/dfu.c
> @@ -32,6 +32,7 @@
> * checking?
> * - make 'dnstate' attached to 'struct usb_device_instance'
> */
> +#define pr_fmt(fmt) "dfu: " fmt
>
> #include <dma.h>
> #include <asm/byteorder.h>
> @@ -209,7 +210,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f)
>
> dfu->dnreq = usb_ep_alloc_request(c->cdev->gadget->ep0);
> if (!dfu->dnreq) {
> - printf("usb_ep_alloc_request failed\n");
> + pr_err("dfu: usb_ep_alloc_request failed\n");
you have missed this one ^^^^^
Best
Bartek
> status = -ENOMEM;
> goto out;
> }
> @@ -254,7 +255,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f)
>
> i = 0;
> file_list_for_each_entry(dfu_files, fentry) {
> - printf("dfu: register alt%d(%s) with device %s\n",
> + pr_err("register alt%d(%s) with device %s\n",
> i, fentry->name, fentry->filename);
> i++;
> }
> @@ -418,7 +419,7 @@ static int handle_manifest(struct usb_function *f, const struct usb_ctrlrequest
>
> ret = copy_file(DFU_TEMPFILE, dfu_file_entry->filename, 0);
> if (ret) {
> - printf("copy file failed\n");
> + pr_err("copy file failed\n");
> ret = -EINVAL;
> goto out;
> }
> @@ -500,7 +501,7 @@ static int dfu_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
> value = -EINVAL;
> goto out;
> }
> - debug("dfu: starting download to %s\n", dfu_file_entry->filename);
> + pr_debug("starting download to %s\n", dfu_file_entry->filename);
> if (dfu_file_entry->flags & FILE_LIST_FLAG_SAFE) {
> dfufd = open(DFU_TEMPFILE, O_WRONLY | O_CREAT);
> } else {
> @@ -529,7 +530,7 @@ static int dfu_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
> return 0;
> case USB_REQ_DFU_UPLOAD:
> dfu->dfu_state = DFU_STATE_dfuUPLOAD_IDLE;
> - debug("dfu: starting upload from %s\n", dfu_file_entry->filename);
> + pr_debug("starting upload from %s\n", dfu_file_entry->filename);
> if (!(dfu_file_entry->flags & FILE_LIST_FLAG_READBACK)) {
> dfu->dfu_state = DFU_STATE_dfuERROR;
> goto out;
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-02-16 9:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 16:34 [PATCH 1/3] usb: gadget: dfu: Use func_to_dfu Jules Maselbas
2021-02-08 16:34 ` [PATCH 2/3] usb: gadget: dfu: Wrap fs operation in workqueue Jules Maselbas
2021-02-15 14:18 ` [PATCH v2 1/2] usb: gadget: dfu: Rework print messages Jules Maselbas
2021-02-15 14:18 ` [PATCH v2 2/2] usb: gadget: dfu: Wrap fs operation in workqueue Jules Maselbas
2021-03-01 9:30 ` [PATCH 1/2] fixup! " Jules Maselbas
2021-03-01 9:30 ` [PATCH 2/2] " Jules Maselbas
2021-03-01 16:03 ` [PATCH 1/2] " Sascha Hauer
2021-03-01 16:06 ` Jules Maselbas
2021-02-16 9:19 ` Bartosz Bilas [this message]
2021-02-16 9:27 ` [PATCH v2 1/2] usb: gadget: dfu: Rework print messages Sascha Hauer
2021-02-16 9:51 ` Jules Maselbas
2021-02-16 9:49 ` Jules Maselbas
2021-02-08 16:34 ` [PATCH 3/3] usb: gadget: dfu: Replace printf with pr_err Jules Maselbas
2021-02-10 9:51 ` Ahmad Fatoum
2021-02-10 9:44 ` [PATCH 1/3] usb: gadget: dfu: Use func_to_dfu Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e8c050e-b72d-5f29-c905-8c8e1bf5e303@grinn-global.com \
--to=b.bilas@grinn-global.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jmaselbas@kalray.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox