diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-02-11 14:26:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:20:31 -0400 |
commit | bc29847e16cb6b571157220ec9b20a7d86e58046 (patch) | |
tree | a62c3361675bebaa69916542acd64c7384f8abca /drivers/usb/host | |
parent | b967c88ed1b48bc353ea83e0cacb2249a3bb1a51 (diff) |
USB: EHCI: Make timer_action out-of-line
This patch (as1205) moves timer_action() from ehci.h to ehci-hcd.c and
makes it out-of-line. Over the years it has grown too big to be inline
any more.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 36 | ||||
-rw-r--r-- | drivers/usb/host/ehci.h | 34 |
2 files changed, 36 insertions, 34 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index e551bb38852b..f2618d17710d 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -110,6 +110,42 @@ MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications"); | |||
110 | 110 | ||
111 | /*-------------------------------------------------------------------------*/ | 111 | /*-------------------------------------------------------------------------*/ |
112 | 112 | ||
113 | static void | ||
114 | timer_action(struct ehci_hcd *ehci, enum ehci_timer_action action) | ||
115 | { | ||
116 | /* Don't override timeouts which shrink or (later) disable | ||
117 | * the async ring; just the I/O watchdog. Note that if a | ||
118 | * SHRINK were pending, OFF would never be requested. | ||
119 | */ | ||
120 | if (timer_pending(&ehci->watchdog) | ||
121 | && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF)) | ||
122 | & ehci->actions)) | ||
123 | return; | ||
124 | |||
125 | if (!test_and_set_bit(action, &ehci->actions)) { | ||
126 | unsigned long t; | ||
127 | |||
128 | switch (action) { | ||
129 | case TIMER_IO_WATCHDOG: | ||
130 | t = EHCI_IO_JIFFIES; | ||
131 | break; | ||
132 | case TIMER_ASYNC_OFF: | ||
133 | t = EHCI_ASYNC_JIFFIES; | ||
134 | break; | ||
135 | /* case TIMER_ASYNC_SHRINK: */ | ||
136 | default: | ||
137 | /* add a jiffie since we synch against the | ||
138 | * 8 KHz uframe counter. | ||
139 | */ | ||
140 | t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1; | ||
141 | break; | ||
142 | } | ||
143 | mod_timer(&ehci->watchdog, t + jiffies); | ||
144 | } | ||
145 | } | ||
146 | |||
147 | /*-------------------------------------------------------------------------*/ | ||
148 | |||
113 | /* | 149 | /* |
114 | * handshake - spin reading hc until handshake completes or fails | 150 | * handshake - spin reading hc until handshake completes or fails |
115 | * @ptr: address of hc register to be read | 151 | * @ptr: address of hc register to be read |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 262b00c9b334..0042deb671dd 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -190,40 +190,6 @@ timer_action_done (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
190 | clear_bit (action, &ehci->actions); | 190 | clear_bit (action, &ehci->actions); |
191 | } | 191 | } |
192 | 192 | ||
193 | static inline void | ||
194 | timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | ||
195 | { | ||
196 | /* Don't override timeouts which shrink or (later) disable | ||
197 | * the async ring; just the I/O watchdog. Note that if a | ||
198 | * SHRINK were pending, OFF would never be requested. | ||
199 | */ | ||
200 | if (timer_pending(&ehci->watchdog) | ||
201 | && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF)) | ||
202 | & ehci->actions)) | ||
203 | return; | ||
204 | |||
205 | if (!test_and_set_bit (action, &ehci->actions)) { | ||
206 | unsigned long t; | ||
207 | |||
208 | switch (action) { | ||
209 | case TIMER_IO_WATCHDOG: | ||
210 | t = EHCI_IO_JIFFIES; | ||
211 | break; | ||
212 | case TIMER_ASYNC_OFF: | ||
213 | t = EHCI_ASYNC_JIFFIES; | ||
214 | break; | ||
215 | // case TIMER_ASYNC_SHRINK: | ||
216 | default: | ||
217 | /* add a jiffie since we synch against the | ||
218 | * 8 KHz uframe counter. | ||
219 | */ | ||
220 | t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1; | ||
221 | break; | ||
222 | } | ||
223 | mod_timer(&ehci->watchdog, t + jiffies); | ||
224 | } | ||
225 | } | ||
226 | |||
227 | static void free_cached_itd_list(struct ehci_hcd *ehci); | 193 | static void free_cached_itd_list(struct ehci_hcd *ehci); |
228 | 194 | ||
229 | /*-------------------------------------------------------------------------*/ | 195 | /*-------------------------------------------------------------------------*/ |