diff options
author | Chris Rorvick <chris@rorvick.com> | 2015-01-12 15:43:00 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-12 16:24:11 -0500 |
commit | d29b854fe9036a505af373ac485b2110ebae6ccd (patch) | |
tree | 596d208ea513e8016ce8496f4a11aa6fdb16fd7b | |
parent | a46c467251353109683d353826208a17aec9383e (diff) |
staging: line6: Make *_disconnect() functions static
Remove declarations from the header and move the definitions up in the
source so they need not be forward declared.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | drivers/staging/line6/pod.c | 58 | ||||
-rw-r--r-- | drivers/staging/line6/pod.h | 1 | ||||
-rw-r--r-- | drivers/staging/line6/podhd.c | 42 | ||||
-rw-r--r-- | drivers/staging/line6/podhd.h | 1 | ||||
-rw-r--r-- | drivers/staging/line6/toneport.c | 64 | ||||
-rw-r--r-- | drivers/staging/line6/toneport.h | 1 | ||||
-rw-r--r-- | drivers/staging/line6/variax.c | 22 | ||||
-rw-r--r-- | drivers/staging/line6/variax.h | 1 |
8 files changed, 94 insertions, 96 deletions
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index b9af5cf50ecf..85a43631996e 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c | |||
@@ -338,6 +338,35 @@ static void pod_destruct(struct usb_interface *interface) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | /* | 340 | /* |
341 | POD device disconnected. | ||
342 | */ | ||
343 | static void line6_pod_disconnect(struct usb_interface *interface) | ||
344 | { | ||
345 | struct usb_line6_pod *pod; | ||
346 | |||
347 | if (interface == NULL) | ||
348 | return; | ||
349 | pod = usb_get_intfdata(interface); | ||
350 | |||
351 | if (pod != NULL) { | ||
352 | struct snd_line6_pcm *line6pcm = pod->line6.line6pcm; | ||
353 | struct device *dev = &interface->dev; | ||
354 | |||
355 | if (line6pcm != NULL) | ||
356 | line6_pcm_disconnect(line6pcm); | ||
357 | |||
358 | if (dev != NULL) { | ||
359 | /* remove sysfs entries: */ | ||
360 | device_remove_file(dev, &dev_attr_device_id); | ||
361 | device_remove_file(dev, &dev_attr_firmware_version); | ||
362 | device_remove_file(dev, &dev_attr_serial_number); | ||
363 | } | ||
364 | } | ||
365 | |||
366 | pod_destruct(interface); | ||
367 | } | ||
368 | |||
369 | /* | ||
341 | Create sysfs entries. | 370 | Create sysfs entries. |
342 | */ | 371 | */ |
343 | static int pod_create_files2(struct device *dev) | 372 | static int pod_create_files2(struct device *dev) |
@@ -422,32 +451,3 @@ int line6_pod_init(struct usb_interface *interface, struct usb_line6 *line6) | |||
422 | 451 | ||
423 | return err; | 452 | return err; |
424 | } | 453 | } |
425 | |||
426 | /* | ||
427 | POD device disconnected. | ||
428 | */ | ||
429 | void line6_pod_disconnect(struct usb_interface *interface) | ||
430 | { | ||
431 | struct usb_line6_pod *pod; | ||
432 | |||
433 | if (interface == NULL) | ||
434 | return; | ||
435 | pod = usb_get_intfdata(interface); | ||
436 | |||
437 | if (pod != NULL) { | ||
438 | struct snd_line6_pcm *line6pcm = pod->line6.line6pcm; | ||
439 | struct device *dev = &interface->dev; | ||
440 | |||
441 | if (line6pcm != NULL) | ||
442 | line6_pcm_disconnect(line6pcm); | ||
443 | |||
444 | if (dev != NULL) { | ||
445 | /* remove sysfs entries: */ | ||
446 | device_remove_file(dev, &dev_attr_device_id); | ||
447 | device_remove_file(dev, &dev_attr_firmware_version); | ||
448 | device_remove_file(dev, &dev_attr_serial_number); | ||
449 | } | ||
450 | } | ||
451 | |||
452 | pod_destruct(interface); | ||
453 | } | ||
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h index 0d78ca76a72f..87a8f0fa9cba 100644 --- a/drivers/staging/line6/pod.h +++ b/drivers/staging/line6/pod.h | |||
@@ -86,7 +86,6 @@ struct usb_line6_pod { | |||
86 | int device_id; | 86 | int device_id; |
87 | }; | 87 | }; |
88 | 88 | ||
89 | extern void line6_pod_disconnect(struct usb_interface *interface); | ||
90 | extern int line6_pod_init(struct usb_interface *interface, | 89 | extern int line6_pod_init(struct usb_interface *interface, |
91 | struct usb_line6 *line6); | 90 | struct usb_line6 *line6); |
92 | 91 | ||
diff --git a/drivers/staging/line6/podhd.c b/drivers/staging/line6/podhd.c index a57fbce3503e..27c5402cece8 100644 --- a/drivers/staging/line6/podhd.c +++ b/drivers/staging/line6/podhd.c | |||
@@ -87,6 +87,27 @@ static void podhd_destruct(struct usb_interface *interface) | |||
87 | } | 87 | } |
88 | 88 | ||
89 | /* | 89 | /* |
90 | POD HD device disconnected. | ||
91 | */ | ||
92 | static void line6_podhd_disconnect(struct usb_interface *interface) | ||
93 | { | ||
94 | struct usb_line6_podhd *podhd; | ||
95 | |||
96 | if (interface == NULL) | ||
97 | return; | ||
98 | podhd = usb_get_intfdata(interface); | ||
99 | |||
100 | if (podhd != NULL) { | ||
101 | struct snd_line6_pcm *line6pcm = podhd->line6.line6pcm; | ||
102 | |||
103 | if (line6pcm != NULL) | ||
104 | line6_pcm_disconnect(line6pcm); | ||
105 | } | ||
106 | |||
107 | podhd_destruct(interface); | ||
108 | } | ||
109 | |||
110 | /* | ||
90 | Try to init POD HD device. | 111 | Try to init POD HD device. |
91 | */ | 112 | */ |
92 | static int podhd_try_init(struct usb_interface *interface, | 113 | static int podhd_try_init(struct usb_interface *interface, |
@@ -133,24 +154,3 @@ int line6_podhd_init(struct usb_interface *interface, struct usb_line6 *line6) | |||
133 | 154 | ||
134 | return err; | 155 | return err; |
135 | } | 156 | } |
136 | |||
137 | /* | ||
138 | POD HD device disconnected. | ||
139 | */ | ||
140 | void line6_podhd_disconnect(struct usb_interface *interface) | ||
141 | { | ||
142 | struct usb_line6_podhd *podhd; | ||
143 | |||
144 | if (interface == NULL) | ||
145 | return; | ||
146 | podhd = usb_get_intfdata(interface); | ||
147 | |||
148 | if (podhd != NULL) { | ||
149 | struct snd_line6_pcm *line6pcm = podhd->line6.line6pcm; | ||
150 | |||
151 | if (line6pcm != NULL) | ||
152 | line6_pcm_disconnect(line6pcm); | ||
153 | } | ||
154 | |||
155 | podhd_destruct(interface); | ||
156 | } | ||
diff --git a/drivers/staging/line6/podhd.h b/drivers/staging/line6/podhd.h index b7d9568e3a6c..a14f711f9725 100644 --- a/drivers/staging/line6/podhd.h +++ b/drivers/staging/line6/podhd.h | |||
@@ -23,7 +23,6 @@ struct usb_line6_podhd { | |||
23 | struct usb_line6 line6; | 23 | struct usb_line6 line6; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | extern void line6_podhd_disconnect(struct usb_interface *interface); | ||
27 | extern int line6_podhd_init(struct usb_interface *interface, | 26 | extern int line6_podhd_init(struct usb_interface *interface, |
28 | struct usb_line6 *line6); | 27 | struct usb_line6 *line6); |
29 | 28 | ||
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index 5c462b72a850..aae78d8a82d9 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c | |||
@@ -336,6 +336,39 @@ static void toneport_setup(struct usb_line6_toneport *toneport) | |||
336 | } | 336 | } |
337 | 337 | ||
338 | /* | 338 | /* |
339 | Toneport device disconnected. | ||
340 | */ | ||
341 | static void line6_toneport_disconnect(struct usb_interface *interface) | ||
342 | { | ||
343 | struct usb_line6_toneport *toneport; | ||
344 | u16 idProduct; | ||
345 | |||
346 | if (interface == NULL) | ||
347 | return; | ||
348 | |||
349 | toneport = usb_get_intfdata(interface); | ||
350 | del_timer_sync(&toneport->timer); | ||
351 | idProduct = le16_to_cpu(toneport->line6.usbdev->descriptor.idProduct); | ||
352 | |||
353 | if (toneport_has_led(idProduct)) { | ||
354 | device_remove_file(&interface->dev, &dev_attr_led_red); | ||
355 | device_remove_file(&interface->dev, &dev_attr_led_green); | ||
356 | } | ||
357 | |||
358 | if (toneport != NULL) { | ||
359 | struct snd_line6_pcm *line6pcm = toneport->line6.line6pcm; | ||
360 | |||
361 | if (line6pcm != NULL) { | ||
362 | line6_pcm_release(line6pcm, LINE6_BITS_PCM_MONITOR); | ||
363 | line6_pcm_disconnect(line6pcm); | ||
364 | } | ||
365 | } | ||
366 | |||
367 | toneport_destruct(interface); | ||
368 | } | ||
369 | |||
370 | |||
371 | /* | ||
339 | Try to init Toneport device. | 372 | Try to init Toneport device. |
340 | */ | 373 | */ |
341 | static int toneport_try_init(struct usb_interface *interface, | 374 | static int toneport_try_init(struct usb_interface *interface, |
@@ -430,34 +463,3 @@ void line6_toneport_reset_resume(struct usb_line6_toneport *toneport) | |||
430 | { | 463 | { |
431 | toneport_setup(toneport); | 464 | toneport_setup(toneport); |
432 | } | 465 | } |
433 | |||
434 | /* | ||
435 | Toneport device disconnected. | ||
436 | */ | ||
437 | void line6_toneport_disconnect(struct usb_interface *interface) | ||
438 | { | ||
439 | struct usb_line6_toneport *toneport; | ||
440 | struct snd_line6_pcm *line6pcm; | ||
441 | |||
442 | if (interface == NULL) | ||
443 | return; | ||
444 | |||
445 | toneport = usb_get_intfdata(interface); | ||
446 | if (NULL == toneport) | ||
447 | return; | ||
448 | |||
449 | del_timer_sync(&toneport->timer); | ||
450 | |||
451 | if (toneport_has_led(toneport->line6.type)) { | ||
452 | device_remove_file(&interface->dev, &dev_attr_led_red); | ||
453 | device_remove_file(&interface->dev, &dev_attr_led_green); | ||
454 | } | ||
455 | |||
456 | line6pcm = toneport->line6.line6pcm; | ||
457 | if (line6pcm != NULL) { | ||
458 | line6_pcm_release(line6pcm, LINE6_BITS_PCM_MONITOR); | ||
459 | line6_pcm_disconnect(line6pcm); | ||
460 | } | ||
461 | |||
462 | toneport_destruct(interface); | ||
463 | } | ||
diff --git a/drivers/staging/line6/toneport.h b/drivers/staging/line6/toneport.h index af2b4e06ce94..8cb14426f6ae 100644 --- a/drivers/staging/line6/toneport.h +++ b/drivers/staging/line6/toneport.h | |||
@@ -44,7 +44,6 @@ struct usb_line6_toneport { | |||
44 | struct timer_list timer; | 44 | struct timer_list timer; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | extern void line6_toneport_disconnect(struct usb_interface *interface); | ||
48 | extern int line6_toneport_init(struct usb_interface *interface, | 47 | extern int line6_toneport_init(struct usb_interface *interface, |
49 | struct usb_line6 *line6); | 48 | struct usb_line6 *line6); |
50 | extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport); | 49 | extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport); |
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index ca25b41ea88b..b4a41b0ad0ea 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c | |||
@@ -172,6 +172,17 @@ static void variax_destruct(struct usb_interface *interface) | |||
172 | } | 172 | } |
173 | 173 | ||
174 | /* | 174 | /* |
175 | Workbench device disconnected. | ||
176 | */ | ||
177 | static void line6_variax_disconnect(struct usb_interface *interface) | ||
178 | { | ||
179 | if (interface == NULL) | ||
180 | return; | ||
181 | |||
182 | variax_destruct(interface); | ||
183 | } | ||
184 | |||
185 | /* | ||
175 | Try to init workbench device. | 186 | Try to init workbench device. |
176 | */ | 187 | */ |
177 | static int variax_try_init(struct usb_interface *interface, | 188 | static int variax_try_init(struct usb_interface *interface, |
@@ -226,14 +237,3 @@ int line6_variax_init(struct usb_interface *interface, struct usb_line6 *line6) | |||
226 | 237 | ||
227 | return err; | 238 | return err; |
228 | } | 239 | } |
229 | |||
230 | /* | ||
231 | Workbench device disconnected. | ||
232 | */ | ||
233 | void line6_variax_disconnect(struct usb_interface *interface) | ||
234 | { | ||
235 | if (interface == NULL) | ||
236 | return; | ||
237 | |||
238 | variax_destruct(interface); | ||
239 | } | ||
diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index f21ff2030f01..dfb94e574cc4 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h | |||
@@ -64,7 +64,6 @@ struct usb_line6_variax { | |||
64 | int startup_progress; | 64 | int startup_progress; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | extern void line6_variax_disconnect(struct usb_interface *interface); | ||
68 | extern int line6_variax_init(struct usb_interface *interface, | 67 | extern int line6_variax_init(struct usb_interface *interface, |
69 | struct usb_line6 *line6); | 68 | struct usb_line6 *line6); |
70 | 69 | ||