Skip to content

Commit 28b7e34

Browse files
committed
ALSA: Remove superfluous hwdep ops
Remove NOP hwdep ops in sound drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e0d8064 commit 28b7e34

8 files changed

Lines changed: 1 addition & 108 deletions

File tree

‎sound/drivers/vx/vx_hwdep.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,6 @@ void snd_vx_free_firmware(struct vx_core *chip)
119119

120120
#else /* old style firmware loading */
121121

122-
static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file)
123-
{
124-
return 0;
125-
}
126-
127-
static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file)
128-
{
129-
return 0;
130-
}
131-
132122
static int vx_hwdep_dsp_status(struct snd_hwdep *hw,
133123
struct snd_hwdep_dsp_status *info)
134124
{
@@ -243,8 +233,6 @@ int snd_vx_setup_firmware(struct vx_core *chip)
243233

244234
hw->iface = SNDRV_HWDEP_IFACE_VX;
245235
hw->private_data = chip;
246-
hw->ops.open = vx_hwdep_open;
247-
hw->ops.release = vx_hwdep_release;
248236
hw->ops.dsp_status = vx_hwdep_dsp_status;
249237
hw->ops.dsp_load = vx_hwdep_dsp_load;
250238
hw->exclusive = 1;

‎sound/pci/mixart/mixart_hwdep.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -581,16 +581,6 @@ MODULE_FIRMWARE("mixart/miXart8AES.xlx");
581581
/* miXart hwdep interface id string */
582582
#define SND_MIXART_HWDEP_ID "miXart Loader"
583583

584-
static int mixart_hwdep_open(struct snd_hwdep *hw, struct file *file)
585-
{
586-
return 0;
587-
}
588-
589-
static int mixart_hwdep_release(struct snd_hwdep *hw, struct file *file)
590-
{
591-
return 0;
592-
}
593-
594584
static int mixart_hwdep_dsp_status(struct snd_hwdep *hw,
595585
struct snd_hwdep_dsp_status *info)
596586
{
@@ -643,8 +633,6 @@ int snd_mixart_setup_firmware(struct mixart_mgr *mgr)
643633

644634
hw->iface = SNDRV_HWDEP_IFACE_MIXART;
645635
hw->private_data = mgr;
646-
hw->ops.open = mixart_hwdep_open;
647-
hw->ops.release = mixart_hwdep_release;
648636
hw->ops.dsp_status = mixart_hwdep_dsp_status;
649637
hw->ops.dsp_load = mixart_hwdep_dsp_load;
650638
hw->exclusive = 1;

‎sound/pci/pcxhr/pcxhr_hwdep.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -471,16 +471,6 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
471471
return 0;
472472
}
473473

474-
static int pcxhr_hwdep_open(struct snd_hwdep *hw, struct file *file)
475-
{
476-
return 0;
477-
}
478-
479-
static int pcxhr_hwdep_release(struct snd_hwdep *hw, struct file *file)
480-
{
481-
return 0;
482-
}
483-
484474
int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
485475
{
486476
int err;
@@ -495,8 +485,6 @@ int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
495485

496486
hw->iface = SNDRV_HWDEP_IFACE_PCXHR;
497487
hw->private_data = mgr;
498-
hw->ops.open = pcxhr_hwdep_open;
499-
hw->ops.release = pcxhr_hwdep_release;
500488
hw->ops.dsp_status = pcxhr_hwdep_dsp_status;
501489
hw->ops.dsp_load = pcxhr_hwdep_dsp_load;
502490
hw->exclusive = 1;

‎sound/pci/rme9652/hdsp.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,13 +4413,6 @@ static int snd_hdsp_capture_release(struct snd_pcm_substream *substream)
44134413
return 0;
44144414
}
44154415

4416-
static int snd_hdsp_hwdep_dummy_op(struct snd_hwdep *hw, struct file *file)
4417-
{
4418-
/* we have nothing to initialize but the call is required */
4419-
return 0;
4420-
}
4421-
4422-
44234416
/* helper functions for copying meter values */
44244417
static inline int copy_u32_le(void __user *dest, void __iomem *src)
44254418
{
@@ -4738,9 +4731,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
47384731
hw->private_data = hdsp;
47394732
strcpy(hw->name, "HDSP hwdep interface");
47404733

4741-
hw->ops.open = snd_hdsp_hwdep_dummy_op;
47424734
hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
4743-
hw->ops.release = snd_hdsp_hwdep_dummy_op;
47444735

47454736
return 0;
47464737
}

‎sound/pci/rme9652/hdspm.c‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,13 +4100,6 @@ static int snd_hdspm_capture_release(struct snd_pcm_substream *substream)
41004100
return 0;
41014101
}
41024102

4103-
static int snd_hdspm_hwdep_dummy_op(struct snd_hwdep * hw, struct file *file)
4104-
{
4105-
/* we have nothing to initialize but the call is required */
4106-
return 0;
4107-
}
4108-
4109-
41104103
static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
41114104
unsigned int cmd, unsigned long arg)
41124105
{
@@ -4213,9 +4206,7 @@ static int __devinit snd_hdspm_create_hwdep(struct snd_card *card,
42134206
hw->private_data = hdspm;
42144207
strcpy(hw->name, "HDSPM hwdep interface");
42154208

4216-
hw->ops.open = snd_hdspm_hwdep_dummy_op;
42174209
hw->ops.ioctl = snd_hdspm_hwdep_ioctl;
4218-
hw->ops.release = snd_hdspm_hwdep_dummy_op;
42194210

42204211
return 0;
42214212
}

‎sound/synth/emux/emux_hwdep.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,6 @@
2424
#include <asm/uaccess.h>
2525
#include "emux_voice.h"
2626

27-
/*
28-
* open the hwdep device
29-
*/
30-
static int
31-
snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file)
32-
{
33-
return 0;
34-
}
35-
36-
37-
/*
38-
* close the device
39-
*/
40-
static int
41-
snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file)
42-
{
43-
return 0;
44-
}
45-
4627

4728
#define TMP_CLIENT_ID 0x1001
4829

@@ -146,8 +127,6 @@ snd_emux_init_hwdep(struct snd_emux *emu)
146127
emu->hwdep = hw;
147128
strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME);
148129
hw->iface = SNDRV_HWDEP_IFACE_EMUX_WAVETABLE;
149-
hw->ops.open = snd_emux_hwdep_open;
150-
hw->ops.release = snd_emux_hwdep_release;
151130
hw->ops.ioctl = snd_emux_hwdep_ioctl;
152131
hw->exclusive = 1;
153132
hw->private_data = emu;

‎sound/usb/usbmixer.c‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ struct usb_mixer_interface {
7878

7979
/* Sound Blaster remote control stuff */
8080
const struct rc_config *rc_cfg;
81-
unsigned long rc_hwdep_open;
8281
u32 rc_code;
8382
wait_queue_head_t rc_waitq;
8483
struct urb *rc_urb;
@@ -1797,24 +1796,6 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb)
17971796
wake_up(&mixer->rc_waitq);
17981797
}
17991798

1800-
static int snd_usb_sbrc_hwdep_open(struct snd_hwdep *hw, struct file *file)
1801-
{
1802-
struct usb_mixer_interface *mixer = hw->private_data;
1803-
1804-
if (test_and_set_bit(0, &mixer->rc_hwdep_open))
1805-
return -EBUSY;
1806-
return 0;
1807-
}
1808-
1809-
static int snd_usb_sbrc_hwdep_release(struct snd_hwdep *hw, struct file *file)
1810-
{
1811-
struct usb_mixer_interface *mixer = hw->private_data;
1812-
1813-
clear_bit(0, &mixer->rc_hwdep_open);
1814-
smp_mb__after_clear_bit();
1815-
return 0;
1816-
}
1817-
18181799
static long snd_usb_sbrc_hwdep_read(struct snd_hwdep *hw, char __user *buf,
18191800
long count, loff_t *offset)
18201801
{
@@ -1867,9 +1848,8 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
18671848
hwdep->iface = SNDRV_HWDEP_IFACE_SB_RC;
18681849
hwdep->private_data = mixer;
18691850
hwdep->ops.read = snd_usb_sbrc_hwdep_read;
1870-
hwdep->ops.open = snd_usb_sbrc_hwdep_open;
1871-
hwdep->ops.release = snd_usb_sbrc_hwdep_release;
18721851
hwdep->ops.poll = snd_usb_sbrc_hwdep_poll;
1852+
hwdep->exclusive = 1;
18731853

18741854
mixer->rc_urb = usb_alloc_urb(0, GFP_KERNEL);
18751855
if (!mixer->rc_urb)

‎sound/usb/usx2y/usX2Yhwdep.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,6 @@ static unsigned int snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file,
106106
}
107107

108108

109-
static int snd_usX2Y_hwdep_open(struct snd_hwdep *hw, struct file *file)
110-
{
111-
return 0;
112-
}
113-
114-
static int snd_usX2Y_hwdep_release(struct snd_hwdep *hw, struct file *file)
115-
{
116-
return 0;
117-
}
118-
119109
static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw,
120110
struct snd_hwdep_dsp_status *info)
121111
{
@@ -267,8 +257,6 @@ int usX2Y_hwdep_new(struct snd_card *card, struct usb_device* device)
267257

268258
hw->iface = SNDRV_HWDEP_IFACE_USX2Y;
269259
hw->private_data = usX2Y(card);
270-
hw->ops.open = snd_usX2Y_hwdep_open;
271-
hw->ops.release = snd_usX2Y_hwdep_release;
272260
hw->ops.dsp_status = snd_usX2Y_hwdep_dsp_status;
273261
hw->ops.dsp_load = snd_usX2Y_hwdep_dsp_load;
274262
hw->ops.mmap = snd_us428ctls_mmap;

0 commit comments

Comments
 (0)