ALSA: us122l: Drop mmap_count field

us122l.mmap_count field was used for counting the hwdep mmap opens and
syncing at disconnection.  But such a manual sync isn't needed, as the
refcount check is done in the ALSA core side.  So let's drop it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20241113111042.15058-4-tiwai@suse.de
This commit is contained in:
Takashi Iwai 2024-11-13 12:10:37 +01:00
parent b7df09bb34
commit f86af06306
2 changed files with 0 additions and 18 deletions

View File

@ -89,13 +89,6 @@ static void pt_info_set(struct usb_device *dev, u8 v)
v, 0, NULL, 0, 1000, GFP_NOIO);
}
static void usb_stream_hwdep_vm_open(struct vm_area_struct *area)
{
struct us122l *us122l = area->vm_private_data;
atomic_inc(&us122l->mmap_count);
}
static vm_fault_t usb_stream_hwdep_vm_fault(struct vm_fault *vmf)
{
unsigned long offset;
@ -132,17 +125,9 @@ static vm_fault_t usb_stream_hwdep_vm_fault(struct vm_fault *vmf)
return VM_FAULT_SIGBUS;
}
static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
{
struct us122l *us122l = area->vm_private_data;
atomic_dec(&us122l->mmap_count);
}
static const struct vm_operations_struct usb_stream_hwdep_vm_ops = {
.open = usb_stream_hwdep_vm_open,
.fault = usb_stream_hwdep_vm_fault,
.close = usb_stream_hwdep_vm_close,
};
static int usb_stream_hwdep_open(struct snd_hwdep *hw, struct file *file)
@ -218,7 +203,6 @@ static int usb_stream_hwdep_mmap(struct snd_hwdep *hw,
if (!read)
vm_flags_set(area, VM_DONTEXPAND);
area->vm_private_data = us122l;
atomic_inc(&us122l->mmap_count);
out:
mutex_unlock(&us122l->mutex);
return err;

View File

@ -16,8 +16,6 @@ struct us122l {
struct file *slave;
struct list_head midi_list;
atomic_t mmap_count;
bool is_us144;
};