Skip to contentSkip to conversation

Staging: comedi: Remove wrapper function definition

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

lore
Share & tools
lore

Evan Chime

author
#0 lore raw

PATCH 5/7 Staging: comedi: Remove wrapper function definition

Remove wrapper function "comedi_buf_map_put" definition as part of remove all wrappers in drivers/staging/comedi/TODO, and replace reference of the wrapper function in the file with the wrapped code

---
 drivers/staging/comedi/comedi_buf.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/staging/comedi/comedi_buf.c +3 -9
index b6a9b5840afb..470eecead7d4 100644
@@ -68,7 +68,8 @@ static void __comedi_buf_free(struct comedi_device *dev,
 	bm = async->buf_map;
 	async->buf_map = NULL;
 	spin_unlock_irqrestore(&s->spin_lock, flags);
-	comedi_buf_map_put(bm);
+	if (bm)
+		kref_put(&bm->refcount, comedi_buf_map_kref_release);
 }
 
 static struct comedi_buf_map *
@@ -133,7 +134,7 @@ comedi_buf_map_alloc(struct comedi_device *dev, enum dma_data_direction dma_dir,
 	return bm;
 
 err:
-	comedi_buf_map_put(bm);
+	kref_put(&bm->refcount, comedi_buf_map_kref_release);
 	return NULL;
 }
 
@@ -187,13 +188,6 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
 	}
 }
 
-int comedi_buf_map_put(struct comedi_buf_map *bm)
-{
-	if (bm)
-		return kref_put(&bm->refcount, comedi_buf_map_kref_release);
-	return 1;
-}
-
 /* helper for "access" vm operation */
 int comedi_buf_map_access(struct comedi_buf_map *bm, unsigned long offset,
 			  void *buf, int len, int write)
Signature · 1 line
2.17.1