ramips: ZyXEL Keenetic Viva: export gpio usb power
[lede.git] / target / linux / layerscape / patches-4.4 / 7160-Staging-fsl-mc-Replace-pr_debug-with-dev_dbg.patch
1 From 8727f71717b449a4c74a5a599374c05822d525f7 Mon Sep 17 00:00:00 2001
2 From: Bhumika Goyal <bhumirks@gmail.com>
3 Date: Fri, 4 Mar 2016 19:14:52 +0530
4 Subject: [PATCH 160/226] Staging: fsl-mc: Replace pr_debug with dev_dbg
5
6 This patch replaces pr_debug calls with dev_dbg when the device structure
7 is available as dev_* prints identifying information about the struct
8 device.
9 Done using coccinelle:
10
11 @r exists@
12 identifier f, s;
13 identifier x;
14 position p;
15 @@
16 f(...,struct s *x,...) {
17 <+...
18 when != x == NULL
19 \(pr_err@p\|pr_debug@p\|pr_info\)(...);
20 ...+>
21 }
22
23 @r2@
24 identifier fld2;
25 identifier r.s;
26 @@
27
28 struct s {
29         ...
30         struct device *fld2;
31         ...
32 };
33
34 @@
35 identifier r.x,r2.fld2;
36 position r.p;
37 @@
38
39 (
40 -pr_err@p
41 +dev_err
42    (
43 + &x->fld2,
44 ...)
45 |
46 - pr_debug@p
47 + dev_dbg
48    (
49 + &x->fld2,
50 ...)
51 |
52 - pr_info@p
53 + dev_info
54    (
55 + &x->fld2,
56 ...)
57 )
58
59 Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
60 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
61 ---
62  drivers/staging/fsl-mc/bus/mc-sys.c |    9 ++++++---
63  1 file changed, 6 insertions(+), 3 deletions(-)
64
65 --- a/drivers/staging/fsl-mc/bus/mc-sys.c
66 +++ b/drivers/staging/fsl-mc/bus/mc-sys.c
67 @@ -328,7 +328,8 @@ static int mc_polling_wait_preemptible(s
68                              MC_CMD_COMPLETION_POLLING_MAX_SLEEP_USECS);
69  
70                 if (time_after_eq(jiffies, jiffies_until_timeout)) {
71 -                       pr_debug("MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
72 +                       dev_dbg(&mc_io->dev,
73 +                               "MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
74                                  mc_io->portal_phys_addr,
75                                  (unsigned int)
76                                         MC_CMD_HDR_READ_TOKEN(cmd->header),
77 @@ -369,7 +370,8 @@ static int mc_polling_wait_atomic(struct
78                 udelay(MC_CMD_COMPLETION_POLLING_MAX_SLEEP_USECS);
79                 timeout_usecs -= MC_CMD_COMPLETION_POLLING_MAX_SLEEP_USECS;
80                 if (timeout_usecs == 0) {
81 -                       pr_debug("MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
82 +                       dev_dbg(&mc_io->dev,
83 +                               "MC command timed out (portal: %#llx, obj handle: %#x, command: %#x)\n",
84                                  mc_io->portal_phys_addr,
85                                  (unsigned int)
86                                         MC_CMD_HDR_READ_TOKEN(cmd->header),
87 @@ -424,7 +426,8 @@ int mc_send_command(struct fsl_mc_io *mc
88                 goto common_exit;
89  
90         if (status != MC_CMD_STATUS_OK) {
91 -               pr_debug("MC command failed: portal: %#llx, obj handle: %#x, command: %#x, status: %s (%#x)\n",
92 +               dev_dbg(&mc_io->dev,
93 +                       "MC command failed: portal: %#llx, obj handle: %#x, command: %#x, status: %s (%#x)\n",
94                          mc_io->portal_phys_addr,
95                          (unsigned int)MC_CMD_HDR_READ_TOKEN(cmd->header),
96                          (unsigned int)MC_CMD_HDR_READ_CMDID(cmd->header),