From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: navin patidar <navinp@cdac.in>
Cc: gregkh@linuxfoundation.org, mfm@muteddisk.com,
linux-usb@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: usbip: replace pr_warning() with dev_warn().
Date: Wed, 26 Jun 2013 16:56:39 +0400 [thread overview]
Message-ID: <51CAE507.409@cogentembedded.com> (raw)
In-Reply-To: <1372239703-4551-1-git-send-email-navinp@cdac.in>
Hello.
On 26-06-2013 13:41, navin patidar wrote:
> dev_warn() is preferred over pr_warning().
> container_of() is used to get usb_driver pointer from usbip_device container
> (stub_device or vhci_device), to get device structure required for dev_warn().
> Signed-off-by: navin patidar <navinp@cdac.in>
> ---
> drivers/staging/usbip/usbip_event.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
> diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
> index 82123be..3bd1b94 100644
> --- a/drivers/staging/usbip/usbip_event.c
> +++ b/drivers/staging/usbip/usbip_event.c
> @@ -21,6 +21,8 @@
> #include <linux/export.h>
>
> #include "usbip_common.h"
> +#include "stub.h"
> +#include "vhci.h"
>
> static int event_handler(struct usbip_device *ud)
> {
> @@ -85,7 +87,17 @@ int usbip_start_eh(struct usbip_device *ud)
>
> ud->eh = kthread_run(event_handler_loop, ud, "usbip_eh");
> if (IS_ERR(ud->eh)) {
> - pr_warning("Unable to start control thread\n");
> + struct device dev;
Empty line after declaration wouldn't hurt here...
> + if (ud->side == USBIP_STUB) {
> + struct stub_device *sdev;
... and here.
> + sdev = container_of(ud, struct stub_device, ud);
> + dev = sdev->udev->dev;
> + } else {
> + struct vhci_device *vdev;
... and here.
> + vdev = container_of(ud, struct vhci_device, ud);
> + dev = vdev->udev->dev;
> + }
> + dev_warn(&dev, "Unable to start control thread\n");
Patch looks clumsy...
WBR, Sergei
prev parent reply other threads:[~2013-06-26 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-26 9:41 [PATCH v2] staging: usbip: replace pr_warning() with dev_warn() navin patidar
2013-06-26 12:56 ` Sergei Shtylyov [this message]
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=51CAE507.409@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mfm@muteddisk.com \
--cc=navinp@cdac.in \
/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