software/drivers/sd8887/src/bluetooth/bt/mbt_char.c
/**
 *	@brief release handler for char dev
 *
 *	@param inode	pointer to structure inode
 *	@param filp	pointer to structure file
 *	@return			0--success otherwise failure
 */
@brief release handler for char dev
@param inode    pointer to structure inode
@param filp     pointer to structure file
@return                 0--success otherwise failure
@brief release handler for char dev @param inode pointer to structure inode @param filp pointer to structure file @return 0 -- success otherwise failure
int
chardev_release(struct inode *inode, struct file *filp)
{
	int ret = 0;
	struct char_dev *dev = (struct char_dev *)filp->private_data;
	struct m_dev *m_dev = NULL;
	ENTER();
	if (!dev) {
		LEAVE();
		return -ENXIO;
	}
	m_dev = dev->m_dev;
#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 7, 0)
	if (m_dev && (atomic_dec_if_positive(&m_dev->extra_cnt) >= 0)) {
		LEAVE();
		return ret;
	}
#endif
	if (m_dev)
		ret = dev->m_dev->close(dev->m_dev);
	filp->private_data = NULL;
	chardev_put(dev);
	LEAVE();
	return ret;
}
int chardev_release ( struct inode * inode , struct file * filp ) { int ret = 0 ; struct char_dev * dev = ( struct char_dev * ) filp -> private_data ; struct m_dev * m_dev = NULL ; ENTER ( ) ; if ( ! dev ) { LEAVE ( ) ; return - ENXIO ; } m_dev = dev -> m_dev ; #if LINUX_VERSION_CODE > KERNEL_VERSION ( 3 , 7 , 0 ) if ( m_dev && ( atomic_dec_if_positive ( & m_dev -> extra_cnt ) >= 0 ) ) { LEAVE ( ) ; return ret ; } #endif if ( m_dev ) ret = dev -> m_dev -> close ( dev -> m_dev ) ; filp -> private_data = NULL ; chardev_put ( dev ) ; LEAVE ( ) ; return ret ; }
@brief release handler for char dev
      @param inode    pointer to structure inode
      @param filp     pointer to structure file
      @return                 0--success otherwise failure
@brief release handler for char dev @param inode pointer to structure inode @param filp pointer to structure file @return 0 -- success otherwise failure