Skip to content

Commit d29b854

Browse files
crorvicktiwai
authored andcommitted
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 <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent a46c467 commit d29b854

File tree

8 files changed

+94
-96
lines changed

8 files changed

+94
-96
lines changed

drivers/staging/line6/pod.c

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,35 @@ static void pod_destruct(struct usb_interface *interface)
337337
cancel_work_sync(&pod->startup_work);
338338
}
339339

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+
340369
/*
341370
Create sysfs entries.
342371
*/
@@ -422,32 +451,3 @@ int line6_pod_init(struct usb_interface *interface, struct usb_line6 *line6)
422451

423452
return err;
424453
}
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-
}

drivers/staging/line6/pod.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ struct usb_line6_pod {
8686
int device_id;
8787
};
8888

89-
extern void line6_pod_disconnect(struct usb_interface *interface);
9089
extern int line6_pod_init(struct usb_interface *interface,
9190
struct usb_line6 *line6);
9291

drivers/staging/line6/podhd.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,27 @@ static void podhd_destruct(struct usb_interface *interface)
8686
line6_cleanup_audio(&podhd->line6);
8787
}
8888

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+
89110
/*
90111
Try to init POD HD device.
91112
*/
@@ -133,24 +154,3 @@ int line6_podhd_init(struct usb_interface *interface, struct usb_line6 *line6)
133154

134155
return err;
135156
}
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-
}

drivers/staging/line6/podhd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ struct usb_line6_podhd {
2323
struct usb_line6 line6;
2424
};
2525

26-
extern void line6_podhd_disconnect(struct usb_interface *interface);
2726
extern int line6_podhd_init(struct usb_interface *interface,
2827
struct usb_line6 *line6);
2928

drivers/staging/line6/toneport.c

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,39 @@ static void toneport_setup(struct usb_line6_toneport *toneport)
335335
toneport_update_led(&usbdev->dev);
336336
}
337337

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+
338371
/*
339372
Try to init Toneport device.
340373
*/
@@ -430,34 +463,3 @@ void line6_toneport_reset_resume(struct usb_line6_toneport *toneport)
430463
{
431464
toneport_setup(toneport);
432465
}
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-
}

drivers/staging/line6/toneport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ struct usb_line6_toneport {
4444
struct timer_list timer;
4545
};
4646

47-
extern void line6_toneport_disconnect(struct usb_interface *interface);
4847
extern int line6_toneport_init(struct usb_interface *interface,
4948
struct usb_line6 *line6);
5049
extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport);

drivers/staging/line6/variax.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,17 @@ static void variax_destruct(struct usb_interface *interface)
171171
kfree(variax->buffer_activate);
172172
}
173173

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+
174185
/*
175186
Try to init workbench device.
176187
*/
@@ -226,14 +237,3 @@ int line6_variax_init(struct usb_interface *interface, struct usb_line6 *line6)
226237

227238
return err;
228239
}
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-
}

drivers/staging/line6/variax.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ struct usb_line6_variax {
6464
int startup_progress;
6565
};
6666

67-
extern void line6_variax_disconnect(struct usb_interface *interface);
6867
extern int line6_variax_init(struct usb_interface *interface,
6968
struct usb_line6 *line6);
7069

0 commit comments

Comments
 (0)