Re: [PATCH v2] staging: usbip: replace pr_warning() with dev_warn().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
  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

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux