Sources/ospboard/opt/osp/src/kernel/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_blk.c
/**
 * dpu_hw_blk_put - put hw_blk to free pool if decremented refcount is zero
 * @hw_blk: hw block to be freed
 * @free_blk: function to be called when reference count goes to zero
 */
put hw_blk to free pool if decremented refcount is zero
@hw_blk: hw block to be freed
@free_blk: function to be called when reference count goes to zero
put hw_blk to free pool if decremented refcount is zero @hw_blk : hw block to be freed @free_blk : function to be called when reference count goes to zero
void dpu_hw_blk_put(struct dpu_hw_blk *hw_blk)
{
	if (!hw_blk) {
		pr_err("invalid parameters\n");
		return;
	}
	pr_debug("hw_blk:%d.%d refcount:%d\n", hw_blk->type, hw_blk->id,
			atomic_read(&hw_blk->refcount));
	if (!atomic_read(&hw_blk->refcount)) {
		pr_err("hw_blk:%d.%d invalid put\n", hw_blk->type, hw_blk->id);
		return;
	}
	if (atomic_dec_return(&hw_blk->refcount))
		return;
	if (hw_blk->ops.stop)
		hw_blk->ops.stop(hw_blk);
}
void dpu_hw_blk_put ( struct dpu_hw_blk * hw_blk ) { if ( ! hw_blk ) { pr_err ( " \n " ) ; return ; } pr_debug ( " \n " , hw_blk -> type , hw_blk -> id , atomic_read ( & hw_blk -> refcount ) ) ; if ( ! atomic_read ( & hw_blk -> refcount ) ) { pr_err ( " \n " , hw_blk -> type , hw_blk -> id ) ; return ; } if ( atomic_dec_return ( & hw_blk -> refcount ) ) return ; if ( hw_blk -> ops . stop ) hw_blk -> ops . stop ( hw_blk ) ; }
dpu_hw_blk_put - put hw_blk to free pool if decremented refcount is zero
 @hw_blk: hw block to be freed
 @free_blk: function to be called when reference count goes to zero
dpu_hw_blk_put - put hw_blk to free pool if decremented refcount is zero @hw_blk : hw block to be freed @free_blk : function to be called when reference count goes to zero