[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1372308329.2060.3.camel@joe-AO722>
Date: Wed, 26 Jun 2013 21:45:29 -0700
From: Joe Perches <joe@...ches.com>
To: navin patidar <navinp@...c.in>
Cc: gregkh@...uxfoundation.org, mfm@...eddisk.com,
sergei.shtylyov@...entembedded.com, linux-usb@...r.kernel.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] staging: usbip: replace pr_warning() with dev_warn().
On Thu, 2013-06-27 at 10:05 +0530, navin patidar wrote:
> dev_warn() is preferred over pr_warning().
[]
> diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
[]
> @@ -85,7 +87,20 @@ 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;
Don't put a struct device on stack,
just use a struct device *
> + if (ud->side == USBIP_STUB) {
> + struct stub_device *sdev;
> +
> + sdev = container_of(ud, struct stub_device, ud);
> + dev = sdev->udev->dev;
dev = &sdev->udev->dev;
> + } else {
> + struct vhci_device *vdev;
> +
> + vdev = container_of(ud, struct vhci_device, ud);
> + dev = vdev->udev->dev;
dev = &vdev->udev->dev;
though maybe
dev = &container_of(udev, struct vhci_device, ud)->udev->dev;
would work too.
> + }
> + dev_warn(&dev, "Unable to start control thread\n");
dev_warn(dev, ...)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists