Skip to content

Commit f86af06

Browse files
committed
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
1 parent b7df09b commit f86af06

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

sound/usb/usx2y/us122l.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ static void pt_info_set(struct usb_device *dev, u8 v)
8989
v, 0, NULL, 0, 1000, GFP_NOIO);
9090
}
9191

92-
static void usb_stream_hwdep_vm_open(struct vm_area_struct *area)
93-
{
94-
struct us122l *us122l = area->vm_private_data;
95-
96-
atomic_inc(&us122l->mmap_count);
97-
}
98-
9992
static vm_fault_t usb_stream_hwdep_vm_fault(struct vm_fault *vmf)
10093
{
10194
unsigned long offset;
@@ -132,17 +125,9 @@ static vm_fault_t usb_stream_hwdep_vm_fault(struct vm_fault *vmf)
132125
return VM_FAULT_SIGBUS;
133126
}
134127

135-
static void usb_stream_hwdep_vm_close(struct vm_area_struct *area)
136-
{
137-
struct us122l *us122l = area->vm_private_data;
138-
139-
atomic_dec(&us122l->mmap_count);
140-
}
141128

142129
static const struct vm_operations_struct usb_stream_hwdep_vm_ops = {
143-
.open = usb_stream_hwdep_vm_open,
144130
.fault = usb_stream_hwdep_vm_fault,
145-
.close = usb_stream_hwdep_vm_close,
146131
};
147132

148133
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,
218203
if (!read)
219204
vm_flags_set(area, VM_DONTEXPAND);
220205
area->vm_private_data = us122l;
221-
atomic_inc(&us122l->mmap_count);
222206
out:
223207
mutex_unlock(&us122l->mutex);
224208
return err;

sound/usb/usx2y/us122l.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ struct us122l {
1616
struct file *slave;
1717
struct list_head midi_list;
1818

19-
atomic_t mmap_count;
20-
2119
bool is_us144;
2220
};
2321

0 commit comments

Comments
 (0)