Staging: gdm724x: replace pr_* with dev_*
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Wed, 18 Mar 2015 10:08:59 +0000 (13:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 10:21:33 +0000 (11:21 +0100)
This patch replace pr_err/pr_info with dev_err/dev_info, when
appropriate device structure is found.

Issue found  and resolved using the following Coccinelle script.
pr_err/dev_err was substituted with pr_info/dev_info in the later case.

@r exists@
identifier f, s, i;
position p;
@@
f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}
@rr@
identifier r.s, s2, fld;
@@

struct s {
...
struct s2 *fld;
...
};

@rrr@
identifier rr.s2, fld2;
@@

struct s2 {
...
struct device fld2;
...
};
@@
identifier r.i, r.s, rr.fld, rrr.fld2;
position r.p;
@@

-pr_err@p
+dev_err
   (
+ &i->fld->fld2,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm724x/gdm_mux.c
drivers/staging/gdm724x/gdm_usb.c

index b987ba0510b79c0a59cce1f172067c2801ef30f7..8199b0a697bb5f8b672aabad8f9685c8c51a8f5e 100644 (file)
@@ -270,7 +270,7 @@ static void gdm_mux_rcv_complete(struct urb *urb)
 
        if (urb->status) {
                if (mux_dev->usb_state == PM_NORMAL)
-                       pr_err("%s: urb status error %d\n",
+                       dev_err(&urb->dev->dev, "%s: urb status error %d\n",
                               __func__, urb->status);
                put_rx_struct(rx, r);
        } else {
@@ -342,7 +342,7 @@ static void gdm_mux_send_complete(struct urb *urb)
        struct mux_tx *t = urb->context;
 
        if (urb->status == -ECONNRESET) {
-               pr_info("CONNRESET\n");
+               dev_info(&urb->dev->dev, "CONNRESET\n");
                free_mux_tx(t);
                return;
        }
index d59810f78c32702fb93b0f596f80652ba9c9a3b3..ed1a12f504e2183e459bc3e43e171255caaf9c38 100644 (file)
@@ -480,7 +480,7 @@ static void gdm_usb_rcv_complete(struct urb *urb)
                spin_unlock_irqrestore(&rx->to_host_lock, flags);
        } else {
                if (urb->status && udev->usb_state == PM_NORMAL)
-                       pr_err("%s: urb status error %d\n",
+                       dev_err(&urb->dev->dev, "%s: urb status error %d\n",
                               __func__, urb->status);
 
                put_rx_struct(rx, r);
@@ -557,7 +557,7 @@ static void gdm_usb_send_complete(struct urb *urb)
        unsigned long flags;
 
        if (urb->status == -ECONNRESET) {
-               pr_info("CONNRESET\n");
+               dev_info(&urb->dev->dev, "CONNRESET\n");
                return;
        }
 
@@ -590,7 +590,8 @@ static int send_tx_packet(struct usb_device *usbdev, struct usb_tx *t, u32 len)
        ret = usb_submit_urb(t->urb, GFP_ATOMIC);
 
        if (ret)
-               pr_err("usb_submit_urb failed: %d\n", ret);
+               dev_err(&usbdev->dev, "usb_submit_urb failed: %d\n",
+                       ret);
 
        usb_mark_last_busy(usbdev);