ALSA: us122l: Drop mmap_count field
authorTakashi Iwai <tiwai@suse.de>
Wed, 13 Nov 2024 11:10:37 +0000 (12:10 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 13 Nov 2024 12:33:47 +0000 (13:33 +0100)
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
sound/usb/usx2y/us122l.c
sound/usb/usx2y/us122l.h

index ca5fac0..6bcf8b8 100644 (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 @@ unlock:
        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;
index c32ae5e..8e59b78 100644 (file)
@@ -16,8 +16,6 @@ struct us122l {
        struct file             *slave;
        struct list_head        midi_list;
 
-       atomic_t                mmap_count;
-
        bool                    is_us144;
 };