Skip to contentSkip to conversation

Staging: comedi: Replace wrapper function

PATCH In review Evan Chime 1 participant 1 message Oct 23, 2019 Staging

lore
Share & tools
lore

Evan Chime

author
#0 lore raw

PATCH 6/7 Staging: comedi: Replace wrapper function

Replace wrapper function "comedi_buf_map_put" reference as part of remove all wrappers in drivers/staging/comedi/TODO, with the wrapped code

---
 drivers/staging/comedi/comedi_fops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/staging/comedi/comedi_fops.c +5 -2
index 96756d8f2459..fff5b6d7955e 100644
@@ -2272,7 +2272,8 @@ static void comedi_vm_close(struct vm_area_struct *area)
 	struct comedi_buf_map *bm;
 
 	bm = area->vm_private_data;
-	comedi_buf_map_put(bm);
+	if (bm)
+		kref_put(&bm->refcount, comedi_buf_map_kref_release);
 }
 
 static int comedi_vm_access(struct vm_area_struct *vma, unsigned long addr,
@@ -2395,7 +2396,9 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
 
 done:
 	up_read(&dev->attach_lock);
-	comedi_buf_map_put(bm);	/* put reference to buf map - okay if NULL */
+	if (bm) /* put reference to buf map - okay if NULL */
+		kref_put(&bm->refcount,
+			 comedi_buf_map_kref_release);
 	return retval;
 }
 
Signature · 1 line
2.17.1