Staging: gdm724x: replace pr_err with dev_err
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Tue, 17 Mar 2015 05:34:20 +0000 (08:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 10:16:36 +0000 (11:16 +0100)
This patch replace pr_err with dev_err, when appropriate device structre
is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

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

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

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 d1ab996b3305af1a9c4d45a2343184e3bafe9503..b987ba0510b79c0a59cce1f172067c2801ef30f7 100644 (file)
@@ -608,7 +608,7 @@ static int gdm_mux_suspend(struct usb_interface *intf, pm_message_t pm_msg)
        rx = &mux_dev->rx;
 
        if (mux_dev->usb_state != PM_NORMAL) {
-               pr_err("usb suspend - invalid state\n");
+               dev_err(intf->usb_dev, "usb suspend - invalid state\n");
                return -1;
        }
 
@@ -637,7 +637,7 @@ static int gdm_mux_resume(struct usb_interface *intf)
        mux_dev = tty_dev->priv_dev;
 
        if (mux_dev->usb_state != PM_SUSPEND) {
-               pr_err("usb resume - invalid state\n");
+               dev_err(intf->usb_dev, "usb resume - invalid state\n");
                return -1;
        }
 
index d2a3b350ba6d10ca77728c7cb5eb8c792f6612e2..d59810f78c32702fb93b0f596f80652ba9c9a3b3 100644 (file)
@@ -848,7 +848,7 @@ static int gdm_usb_probe(struct usb_interface *intf,
        udev->usbdev = usbdev;
        ret = init_usb(udev);
        if (ret < 0) {
-               pr_err("init_usb func failed\n");
+               dev_err(intf->usb_dev, "init_usb func failed\n");
                goto err_init_usb;
        }
        udev->intf = intf;
@@ -867,7 +867,7 @@ static int gdm_usb_probe(struct usb_interface *intf,
 
        ret = request_mac_address(udev);
        if (ret < 0) {
-               pr_err("request Mac address failed\n");
+               dev_err(intf->usb_dev, "request Mac address failed\n");
                goto err_mac_address;
        }
 
@@ -928,7 +928,7 @@ static int gdm_usb_suspend(struct usb_interface *intf, pm_message_t pm_msg)
        udev = phy_dev->priv_dev;
        rx = &udev->rx;
        if (udev->usb_state != PM_NORMAL) {
-               pr_err("usb suspend - invalid state\n");
+               dev_err(intf->usb_dev, "usb suspend - invalid state\n");
                return -1;
        }
 
@@ -961,7 +961,7 @@ static int gdm_usb_resume(struct usb_interface *intf)
        rx = &udev->rx;
 
        if (udev->usb_state != PM_SUSPEND) {
-               pr_err("usb resume - invalid state\n");
+               dev_err(intf->usb_dev, "usb resume - invalid state\n");
                return -1;
        }
        udev->usb_state = PM_NORMAL;