aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/chipidea/debug.c')
-rw-r--r--drivers/usb/chipidea/debug.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c
index 3869c6d75515..080b7be3daf0 100644
--- a/drivers/usb/chipidea/debug.c
+++ b/drivers/usb/chipidea/debug.c
@@ -67,9 +67,11 @@ static int ci_port_test_show(struct seq_file *s, void *data)
67 unsigned long flags; 67 unsigned long flags;
68 unsigned mode; 68 unsigned mode;
69 69
70 pm_runtime_get_sync(ci->dev);
70 spin_lock_irqsave(&ci->lock, flags); 71 spin_lock_irqsave(&ci->lock, flags);
71 mode = hw_port_test_get(ci); 72 mode = hw_port_test_get(ci);
72 spin_unlock_irqrestore(&ci->lock, flags); 73 spin_unlock_irqrestore(&ci->lock, flags);
74 pm_runtime_put_sync(ci->dev);
73 75
74 seq_printf(s, "mode = %u\n", mode); 76 seq_printf(s, "mode = %u\n", mode);
75 77
@@ -99,9 +101,11 @@ static ssize_t ci_port_test_write(struct file *file, const char __user *ubuf,
99 if (sscanf(buf, "%u", &mode) != 1) 101 if (sscanf(buf, "%u", &mode) != 1)
100 return -EINVAL; 102 return -EINVAL;
101 103
104 pm_runtime_get_sync(ci->dev);
102 spin_lock_irqsave(&ci->lock, flags); 105 spin_lock_irqsave(&ci->lock, flags);
103 ret = hw_port_test_set(ci, mode); 106 ret = hw_port_test_set(ci, mode);
104 spin_unlock_irqrestore(&ci->lock, flags); 107 spin_unlock_irqrestore(&ci->lock, flags);
108 pm_runtime_put_sync(ci->dev);
105 109
106 return ret ? ret : count; 110 return ret ? ret : count;
107} 111}
@@ -317,8 +321,10 @@ static ssize_t ci_role_write(struct file *file, const char __user *ubuf,
317 if (role == CI_ROLE_END || role == ci->role) 321 if (role == CI_ROLE_END || role == ci->role)
318 return -EINVAL; 322 return -EINVAL;
319 323
324 pm_runtime_get_sync(ci->dev);
320 ci_role_stop(ci); 325 ci_role_stop(ci);
321 ret = ci_role_start(ci, role); 326 ret = ci_role_start(ci, role);
327 pm_runtime_put_sync(ci->dev);
322 328
323 return ret ? ret : count; 329 return ret ? ret : count;
324} 330}