fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
baabf4bbf3
commit
7aa45305b7
@ -823,7 +823,7 @@ static int cxd56_emmc_open(struct inode *inode)
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
/* Just increment the reference count on the driver */
|
||||
@ -844,7 +844,7 @@ static int cxd56_emmc_close(struct inode *inode)
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
/* Decrement the reference count on the block driver */
|
||||
@ -868,7 +868,7 @@ static ssize_t cxd56_emmc_read(struct inode *inode,
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
finfo("Read sector %" PRIuOFF " (%u sectors) to %p\n",
|
||||
@ -893,7 +893,7 @@ static ssize_t cxd56_emmc_write(struct inode *inode,
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
finfo("Write %p to sector %" PRIu32 " (%u sectors)\n", buffer,
|
||||
@ -915,7 +915,7 @@ static int cxd56_emmc_geometry(struct inode *inode,
|
||||
{
|
||||
struct cxd56_emmc_state_s *priv;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct cxd56_emmc_state_s *)inode->i_private;
|
||||
|
||||
memset(geometry, 0, sizeof(*geometry));
|
||||
|
@ -198,7 +198,6 @@ static int hif_open(struct file *filep)
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
@ -253,7 +252,6 @@ static int hif_close(struct file *filep)
|
||||
struct inode *inode;
|
||||
struct cxd56_hifdev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
@ -281,7 +279,6 @@ static ssize_t hif_read(struct file *filep, char *buffer, size_t len)
|
||||
struct cxd56_hifdev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
@ -313,7 +310,6 @@ static ssize_t hif_write(struct file *filep,
|
||||
struct cxd56_hifdev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (struct cxd56_hifdev_s *)inode->i_private;
|
||||
|
@ -553,7 +553,7 @@ static ssize_t cxd56_powermgr_procfs_read(struct file *filep,
|
||||
pminfo("READ buffer=%p buflen=%lu len=%lu\n", buffer,
|
||||
(unsigned long)buflen, g_powermg_procfs_len);
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
|
||||
priv = (struct cxd56_powermgr_procfs_file_s *)filep->f_priv;
|
||||
|
||||
|
@ -534,7 +534,6 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct efm32_leuart_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -804,9 +804,6 @@ static int efm32_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
DEBUGASSERT(filep->f_inode);
|
||||
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -1114,7 +1114,6 @@ static int kinetis_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) || \
|
||||
defined(CONFIG_KINETIS_SERIALBRK_BSDCOMPAT)
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
|
@ -1277,7 +1277,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL && dev->priv != NULL);
|
||||
|
@ -586,7 +586,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -131,7 +131,7 @@ static ssize_t mmcl_read(struct inode *inode, unsigned char *buffer,
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
|
||||
nread = MTD_BREAD(dev->mtd, start_sector, nsectors, buffer);
|
||||
@ -161,7 +161,7 @@ static ssize_t mmcl_write(struct inode *inode,
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
|
||||
nwrite = MTD_BWRITE(dev->mtd, start_sector, nsectors, buffer);
|
||||
@ -188,7 +188,6 @@ static int mmcl_geometry(struct inode *inode, struct geometry *geometry)
|
||||
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
@ -226,7 +225,7 @@ static int mmcl_ioctl(struct inode *inode, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
|
||||
ret = MTD_IOCTL(dev->mtd, cmd, arg);
|
||||
|
@ -1128,7 +1128,6 @@ static int lpc54_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct lpc54_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -563,7 +563,6 @@ static int max326_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct max326_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -608,7 +608,6 @@ static ssize_t phyplus_stub_write(struct file *filep,
|
||||
|
||||
int ret = 0;
|
||||
static int cmd_pos = 0;
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
|
||||
@ -696,7 +695,6 @@ static int phyplus_stub_ioctl(struct file *filep, int cmd,
|
||||
* int j = 0;
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
|
||||
|
@ -156,7 +156,7 @@ static int eeed_open(struct inode *inode)
|
||||
{
|
||||
struct eeed_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
|
||||
/* Increment the open reference count */
|
||||
@ -181,7 +181,7 @@ static int eeed_close(struct inode *inode)
|
||||
{
|
||||
struct eeed_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
|
||||
/* Increment the open reference count */
|
||||
@ -206,7 +206,7 @@ static ssize_t eeed_read(struct inode *inode, unsigned char *buffer,
|
||||
{
|
||||
struct eeed_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIu64 " nsectors: %u sectorsize: %d\n",
|
||||
@ -243,7 +243,7 @@ static ssize_t eeed_write(struct inode *inode,
|
||||
{
|
||||
struct eeed_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIu64 " nsectors: %u sectorsize: %d\n",
|
||||
@ -288,7 +288,6 @@ static int eeed_geometry(struct inode *inode, struct geometry *geometry)
|
||||
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
@ -329,7 +328,7 @@ static int eeed_ioctl(struct inode *inode, int cmd, unsigned long arg)
|
||||
|
||||
/* Only one ioctl command is supported */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
if (cmd == BIOC_XIPBASE && ppv)
|
||||
{
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
@ -355,7 +354,7 @@ static int eeed_unlink(struct inode *inode)
|
||||
{
|
||||
struct eeed_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct eeed_struct_s *)inode->i_private;
|
||||
|
||||
/* And free the block driver itself */
|
||||
|
@ -970,10 +970,9 @@ static ssize_t sam_tsd_read(struct file *filep, char *buffer, size_t len)
|
||||
int ret;
|
||||
|
||||
iinfo("buffer:%p len:%d\n", buffer, len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct sam_tsd_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -1105,10 +1104,9 @@ static int sam_tsd_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
int regval;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct sam_tsd_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1164,10 +1162,10 @@ static int sam_tsd_poll(struct file *filep, struct pollfd *fds, bool setup)
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct sam_tsd_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the ADC hardware */
|
||||
|
@ -254,7 +254,7 @@ static int stm32_bbsram_open(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Increment the reference count */
|
||||
@ -309,7 +309,7 @@ static int stm32_bbsram_close(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -357,7 +357,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||
off_t newpos;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -427,7 +427,7 @@ static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -473,7 +473,7 @@ static ssize_t stm32_bbsram_write(struct file *filep,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -EFBIG;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Forbid writes past the end of the device */
|
||||
@ -537,7 +537,7 @@ static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
if (cmd == STM32_BBSRAM_GETDESC_IOCTL)
|
||||
@ -590,7 +590,7 @@ static int stm32_bbsram_unlink(struct inode *inode)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
|
@ -254,7 +254,7 @@ static int stm32_bbsram_open(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Increment the reference count */
|
||||
@ -309,7 +309,7 @@ static int stm32_bbsram_close(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -357,7 +357,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||
off_t newpos;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -427,7 +427,7 @@ static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -473,7 +473,7 @@ static ssize_t stm32_bbsram_write(struct file *filep,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -EFBIG;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Forbid writes past the end of the device */
|
||||
@ -537,7 +537,7 @@ static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
if (cmd == STM32F7_BBSRAM_GETDESC_IOCTL)
|
||||
@ -590,7 +590,7 @@ static int stm32_bbsram_unlink(struct inode *inode)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
|
@ -300,7 +300,7 @@ static int stm32_bbsram_open(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Increment the reference count */
|
||||
@ -355,7 +355,7 @@ static int stm32_bbsram_close(struct file *filep)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -403,7 +403,7 @@ static off_t stm32_bbsram_seek(struct file *filep, off_t offset,
|
||||
off_t newpos;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -473,7 +473,7 @@ static ssize_t stm32_bbsram_read(struct file *filep, char *buffer,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
@ -520,7 +520,7 @@ static ssize_t stm32_bbsram_write(struct file *filep,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -EFBIG;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
/* Forbid writes past the end of the device */
|
||||
@ -584,7 +584,7 @@ static int stm32_bbsram_ioctl(struct file *filep, int cmd,
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
if (cmd == STM32H7_BBSRAM_GETDESC_IOCTL)
|
||||
@ -637,7 +637,7 @@ static int stm32_bbsram_unlink(struct inode *inode)
|
||||
struct stm32_bbsram_s *bbr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct stm32_bbsram_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bbr->lock);
|
||||
|
@ -802,7 +802,6 @@ static int xmc4_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct xmc4_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -491,7 +491,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -564,7 +564,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -206,7 +206,7 @@ static int rx65n_sbram_open(struct file *filep)
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct rx65n_sbram_s *bbr;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
/* Increment the reference count */
|
||||
@ -257,7 +257,7 @@ static int rx65n_sbram_close(struct file *filep)
|
||||
struct rx65n_sbram_s *bbr;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&bbr->lock);
|
||||
@ -299,7 +299,7 @@ static off_t rx65n_sbram_seek(struct file *filep, off_t offset,
|
||||
off_t newpos;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&bbr->lock);
|
||||
@ -368,7 +368,7 @@ static ssize_t rx65n_sbram_read(struct file *filep, char *buffer,
|
||||
struct inode *inode = filep->f_inode;
|
||||
struct rx65n_sbram_s *bbr;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&bbr->lock);
|
||||
@ -410,7 +410,7 @@ static ssize_t rx65n_sbram_write(struct file *filep, const char *buffer,
|
||||
struct rx65n_sbram_s *bbr;
|
||||
int ret = -EFBIG;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
/* Forbid writes past the end of the device */
|
||||
@ -466,7 +466,7 @@ static int rx65n_sbram_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct rx65n_sbram_s *bbr;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
if (cmd == RX65N_SBRAM_GETDESC_IOCTL)
|
||||
@ -513,7 +513,7 @@ static int rx65n_sbram_unlink(struct inode *inode)
|
||||
{
|
||||
struct rx65n_sbram_s *bbr;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bbr = (struct rx65n_sbram_s *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&bbr->lock);
|
||||
|
@ -576,7 +576,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -572,7 +572,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -638,7 +638,6 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
struct up_dev_s *priv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep, filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
|
||||
|
@ -126,7 +126,7 @@ static int smbus_sbd_open(struct file *filep)
|
||||
|
||||
/* Retrieve the smbus_sbd_dev_s struct */
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && filep->f_inode->i_private);
|
||||
DEBUGASSERT(filep->f_inode->i_private);
|
||||
dev = (struct smbus_sbd_dev_s *)filep->f_inode->i_private;
|
||||
|
||||
/* Increase the open reference count */
|
||||
@ -158,7 +158,7 @@ static int smbus_sbd_close(struct file *filep)
|
||||
|
||||
/* Retrieve the smbus_sbd_dev_s struct */
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && filep->f_inode->i_private);
|
||||
DEBUGASSERT(filep->f_inode->i_private);
|
||||
dev = (struct smbus_sbd_dev_s *)filep->f_inode->i_private;
|
||||
|
||||
/* Decrease the open reference count */
|
||||
@ -222,7 +222,7 @@ static ssize_t smbus_sbd_read(struct file *filep, char *buffer,
|
||||
* Battery Data slave driver.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && filep->f_inode->i_private);
|
||||
DEBUGASSERT(filep->f_inode->i_private);
|
||||
dev = (struct smbus_sbd_dev_s *)filep->f_inode->i_private;
|
||||
|
||||
DEBUGASSERT(buffer);
|
||||
@ -320,7 +320,7 @@ static ssize_t smbus_sbd_write(struct file *filep, const char *buffer,
|
||||
* Battery Data slave driver.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && filep->f_inode->i_private);
|
||||
DEBUGASSERT(filep->f_inode->i_private);
|
||||
dev = (struct smbus_sbd_dev_s *)filep->f_inode->i_private;
|
||||
|
||||
DEBUGASSERT(buffer);
|
||||
|
@ -1095,10 +1095,9 @@ static int tc_open(struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1147,10 +1146,9 @@ static int tc_close(struct file *filep)
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1188,10 +1186,9 @@ static ssize_t tc_read(struct file *filep, char *buffer, size_t len)
|
||||
struct tc_sample_s sample;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -1312,10 +1309,9 @@ static int tc_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1354,10 +1350,10 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -972,10 +972,9 @@ static int tc_open(struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1024,10 +1023,9 @@ static int tc_close(struct file *filep)
|
||||
struct tc_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1065,10 +1063,9 @@ static ssize_t tc_read(struct file *filep, char *buffer, size_t len)
|
||||
struct tc_sample_s sample;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -1189,10 +1186,9 @@ static int tc_ioctl(struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1231,10 +1227,10 @@ static int tc_poll(struct file *filep, struct pollfd *fds, bool setup)
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (struct tc_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -118,7 +118,7 @@ static int bch_open(FAR struct file *filep)
|
||||
FAR struct bchlib_s *bch;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
/* Increment the reference count */
|
||||
@ -155,7 +155,7 @@ static int bch_close(FAR struct file *filep)
|
||||
FAR struct bchlib_s *bch;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
@ -223,7 +223,7 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
off_t newpos;
|
||||
off_t ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
ret = nxmutex_lock(&bch->lock);
|
||||
@ -294,7 +294,7 @@ static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
FAR struct bchlib_s *bch;
|
||||
ssize_t ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&bch->lock);
|
||||
@ -324,7 +324,7 @@ static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer,
|
||||
FAR struct bchlib_s *bch;
|
||||
ssize_t ret = -EACCES;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
if (!bch->readonly)
|
||||
@ -361,7 +361,7 @@ static int bch_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct bchlib_s *bch;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
/* Process the call according to the command */
|
||||
@ -473,7 +473,7 @@ static int bch_unlink(FAR struct inode *inode)
|
||||
FAR struct bchlib_s *bch;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
bch = (FAR struct bchlib_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the BCH device */
|
||||
|
@ -1414,10 +1414,9 @@ static int mfrc522_open(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct mfrc522_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
mfrc522_configspi(dev->spi);
|
||||
@ -1443,10 +1442,9 @@ static int mfrc522_close(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct mfrc522_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
dev->state = MFRC522_STATE_NOT_INIT;
|
||||
@ -1472,10 +1470,9 @@ static ssize_t mfrc522_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct mfrc522_dev_s *dev;
|
||||
FAR struct picc_uid_s uid;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
/* Is a card near? */
|
||||
@ -1516,10 +1513,9 @@ static ssize_t mfrc522_write(FAR struct file *filep, FAR const char *buffer,
|
||||
FAR struct inode *inode;
|
||||
FAR struct mfrc522_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
UNUSED(dev);
|
||||
@ -1537,10 +1533,9 @@ static int mfrc522_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct mfrc522_dev_s *dev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
switch (cmd)
|
||||
|
@ -850,10 +850,9 @@ static int _open(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct pn532_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
pn532_configspi(dev->spi);
|
||||
@ -881,10 +880,9 @@ static int _close(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct pn532_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
dev->config->reset(0);
|
||||
@ -918,10 +916,9 @@ static ssize_t _read(FAR struct file *filep, FAR char *buffer, size_t buflen)
|
||||
FAR struct inode *inode;
|
||||
FAR struct pn532_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
uint32_t id = pn532_read_passive_target_id(dev, PN532_MIFARE_ISO14443A);
|
||||
@ -946,10 +943,9 @@ static ssize_t _write(FAR struct file *filep, FAR const char *buffer,
|
||||
FAR struct inode *inode;
|
||||
FAR struct pn532_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
UNUSED(dev);
|
||||
@ -967,10 +963,9 @@ static int _ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct pn532_dev_s *dev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = inode->i_private;
|
||||
|
||||
switch (cmd)
|
||||
|
@ -345,7 +345,7 @@ static int ee24xx_open(FAR struct file *filep)
|
||||
FAR struct ee24xx_dev_s *eedev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -382,7 +382,7 @@ static int ee24xx_close(FAR struct file *filep)
|
||||
FAR struct ee24xx_dev_s *eedev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -422,7 +422,7 @@ static off_t ee24xx_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
int ret;
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -498,7 +498,7 @@ static ssize_t ee24xx_read(FAR struct file *filep, FAR char *buffer,
|
||||
uint32_t addr_hi;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -577,7 +577,7 @@ static ssize_t at24cs_read_uuid(FAR struct file *filep, FAR char *buffer,
|
||||
uint8_t regindx;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -653,7 +653,7 @@ static ssize_t ee24xx_write(FAR struct file *filep, FAR const char *buffer,
|
||||
int ret = -EACCES;
|
||||
int savelen;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
|
||||
if (eedev->readonly)
|
||||
@ -779,7 +779,7 @@ static int ee24xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
int ret = 0;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee24xx_dev_s *)inode->i_private;
|
||||
UNUSED(eedev);
|
||||
|
||||
|
@ -467,7 +467,7 @@ static int ee25xx_open(FAR struct file *filep)
|
||||
FAR struct ee25xx_dev_s *eedev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -504,7 +504,7 @@ static int ee25xx_close(FAR struct file *filep)
|
||||
FAR struct ee25xx_dev_s *eedev;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -544,7 +544,7 @@ static off_t ee25xx_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
int ret;
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -616,7 +616,7 @@ static ssize_t ee25xx_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&eedev->lock);
|
||||
@ -668,7 +668,7 @@ static ssize_t ee25xx_write(FAR struct file *filep, FAR const char *buffer,
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
int ret = -EACCES;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
|
||||
if (eedev->readonly)
|
||||
@ -765,7 +765,7 @@ static int ee25xx_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct inode *inode = filep->f_inode;
|
||||
int ret = 0;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
eedev = (FAR struct ee25xx_dev_s *)inode->i_private;
|
||||
UNUSED(eedev);
|
||||
|
||||
|
@ -124,7 +124,6 @@ static int i2cdrvr_open(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct i2c_driver_s *)inode->i_private;
|
||||
@ -161,7 +160,6 @@ static int i2cdrvr_close(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct i2c_driver_s *)inode->i_private;
|
||||
@ -231,7 +229,6 @@ static int i2cdrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct i2c_driver_s *)inode->i_private;
|
||||
@ -308,7 +305,7 @@ static int i2cdrvr_unlink(FAR struct inode *inode)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct i2c_driver_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the I2C driver state structure */
|
||||
|
@ -217,10 +217,9 @@ static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && buffer != NULL);
|
||||
DEBUGASSERT(buffer != NULL);
|
||||
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL);
|
||||
|
||||
priv = (FAR struct i2schar_dev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -290,10 +289,9 @@ static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep && buffer);
|
||||
DEBUGASSERT(buffer);
|
||||
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode);
|
||||
|
||||
priv = (FAR struct i2schar_dev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv);
|
||||
@ -358,10 +356,7 @@ static int i2schar_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL);
|
||||
|
||||
priv = (FAR struct i2schar_dev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv != NULL && priv->i2s && priv->i2s->ops);
|
||||
|
@ -713,10 +713,9 @@ static int ads7843e_open(FAR struct file *filep)
|
||||
|
||||
iinfo("Opening\n");
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ads7843e_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -767,10 +766,9 @@ static int ads7843e_close(FAR struct file *filep)
|
||||
int ret;
|
||||
|
||||
iinfo("Closing\n");
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ads7843e_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -811,10 +809,9 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer,
|
||||
int ret;
|
||||
|
||||
iinfo("buffer:%p len:%d\n", buffer, len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ads7843e_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -938,10 +935,9 @@ static int ads7843e_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ads7843e_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -994,10 +990,10 @@ static int ads7843e_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ads7843e_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -297,7 +297,6 @@ static int ajoy_open(FAR struct file *filep)
|
||||
ajoy_buttonset_t supported;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ajoy_upperhalf_s *)inode->i_private;
|
||||
@ -352,7 +351,7 @@ static int ajoy_close(FAR struct file *filep)
|
||||
FAR struct ajoy_open_s *prev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -415,7 +414,6 @@ static ssize_t ajoy_read(FAR struct file *filep, FAR char *buffer,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -465,7 +463,7 @@ static int ajoy_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -590,7 +588,7 @@ static int ajoy_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
@ -309,7 +309,6 @@ static int btn_open(FAR struct file *filep)
|
||||
btn_buttonset_t supported;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct btn_upperhalf_s *)inode->i_private;
|
||||
@ -364,7 +363,7 @@ static int btn_close(FAR struct file *filep)
|
||||
FAR struct btn_open_s *prev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -432,7 +431,6 @@ static ssize_t btn_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR const struct btn_lowerhalf_s *lower;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -478,7 +476,6 @@ static ssize_t btn_write(FAR struct file *filep, FAR const char *buffer,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct btn_upperhalf_s *)inode->i_private;
|
||||
@ -529,7 +526,7 @@ static int btn_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -656,7 +653,7 @@ static int btn_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
@ -736,10 +736,9 @@ static ssize_t mbr3108_read(FAR struct file *filep, FAR char *buffer,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
@ -783,10 +782,9 @@ static ssize_t mbr3108_write(FAR struct file *filep, FAR const char *buffer,
|
||||
enum mbr3108_cmd_e type;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
if (buflen < sizeof(enum mbr3108_cmd_e))
|
||||
@ -864,10 +862,9 @@ static int mbr3108_open(FAR struct file *filep)
|
||||
unsigned int use_count;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
@ -938,10 +935,9 @@ static int mbr3108_close(FAR struct file *filep)
|
||||
int use_count;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
@ -988,10 +984,10 @@ static int mbr3108_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mbr3108_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
|
@ -297,7 +297,6 @@ static int djoy_open(FAR struct file *filep)
|
||||
djoy_buttonset_t supported;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct djoy_upperhalf_s *)inode->i_private;
|
||||
@ -352,7 +351,7 @@ static int djoy_close(FAR struct file *filep)
|
||||
FAR struct djoy_open_s *prev;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -415,7 +414,6 @@ static ssize_t djoy_read(FAR struct file *filep, FAR char *buffer,
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -461,7 +459,7 @@ static int djoy_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
irqstate_t flags;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -586,7 +584,7 @@ static int djoy_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
@ -732,10 +732,9 @@ static int ft5x06_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ft5x06_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -791,10 +790,9 @@ static int ft5x06_close(FAR struct file *filep)
|
||||
FAR struct ft5x06_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ft5x06_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -839,10 +837,9 @@ static ssize_t ft5x06_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct ft5x06_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ft5x06_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -912,10 +909,9 @@ static int ft5x06_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ft5x06_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -969,10 +965,10 @@ static int ft5x06_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ft5x06_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -488,9 +488,8 @@ static ssize_t gt9xx_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Get the Touch Panel Device */
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
/* Begin Mutex: Lock to prevent concurrent reads */
|
||||
@ -606,9 +605,8 @@ static int gt9xx_open(FAR struct file *filep)
|
||||
/* Get the Touch Panel Device */
|
||||
|
||||
iinfo("\n");
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
/* Begin Mutex: Lock to prevent concurrent update to Reference Count */
|
||||
@ -692,9 +690,8 @@ static int gt9xx_close(FAR struct file *filep)
|
||||
/* Get the Touch Panel Device */
|
||||
|
||||
iinfo("\n");
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
/* Begin Mutex: Lock to prevent concurrent update to Reference Count */
|
||||
@ -762,9 +759,9 @@ static int gt9xx_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
/* Get the Touch Panel Device */
|
||||
|
||||
iinfo("setup=%d\n", setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct gt9xx_dev_s *)inode->i_private;
|
||||
|
||||
/* Begin Mutex: Lock to prevent concurrent update to Poll Waiters */
|
||||
|
@ -706,10 +706,9 @@ static int max11802_open(FAR struct file *filep)
|
||||
|
||||
iinfo("Opening\n");
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max11802_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -760,10 +759,9 @@ static int max11802_close(FAR struct file *filep)
|
||||
int ret;
|
||||
|
||||
iinfo("Closing\n");
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max11802_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -804,10 +802,9 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer,
|
||||
int ret;
|
||||
|
||||
iinfo("buffer:%p len:%d\n", buffer, len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max11802_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -931,10 +928,9 @@ static int max11802_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max11802_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -987,10 +983,10 @@ static int max11802_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max11802_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -1104,10 +1104,9 @@ static int mxt_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mxt_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1182,10 +1181,9 @@ static int mxt_close(FAR struct file *filep)
|
||||
FAR struct mxt_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mxt_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1237,10 +1235,9 @@ static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
int i;
|
||||
int j;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mxt_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -1464,10 +1461,9 @@ static int mxt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mxt_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1521,10 +1517,10 @@ static int mxt_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mxt_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -275,7 +275,6 @@ static int nunchuck_open(FAR struct file *filep)
|
||||
FAR struct nunchuck_open_s *opriv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct nunchuck_dev_s *)inode->i_private;
|
||||
@ -330,7 +329,7 @@ static int nunchuck_close(FAR struct file *filep)
|
||||
bool closing;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -414,7 +413,6 @@ static ssize_t nunchuck_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct nunchuck_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct nunchuck_dev_s *)inode->i_private;
|
||||
@ -462,7 +460,7 @@ static int nunchuck_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct nunchuck_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct nunchuck_dev_s *)inode->i_private;
|
||||
|
@ -453,7 +453,6 @@ static int spq10kbd_open(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct spq10kbd_dev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
priv = inode->i_private;
|
||||
|
||||
@ -477,7 +476,6 @@ static int spq10kbd_close(FAR struct file *filep)
|
||||
FAR struct inode *inode;
|
||||
FAR struct spq10kbd_dev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
priv = inode->i_private;
|
||||
|
||||
@ -507,7 +505,7 @@ static ssize_t spq10kbd_read(FAR struct file *filep, FAR char *buffer,
|
||||
uint16_t tail;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && buffer);
|
||||
DEBUGASSERT(buffer);
|
||||
inode = filep->f_inode;
|
||||
priv = inode->i_private;
|
||||
|
||||
@ -607,7 +605,7 @@ static int spq10kbd_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
priv = inode->i_private;
|
||||
|
||||
|
@ -308,10 +308,9 @@ static int stmpe811_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct stmpe811_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -365,10 +364,9 @@ static int stmpe811_close(FAR struct file *filep)
|
||||
FAR struct stmpe811_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct stmpe811_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -413,10 +411,9 @@ static ssize_t stmpe811_read(FAR struct file *filep,
|
||||
int ret;
|
||||
|
||||
iinfo("len=%d\n", len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct stmpe811_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -538,10 +535,9 @@ static int stmpe811_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct stmpe811_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -631,10 +627,10 @@ static int stmpe811_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct stmpe811_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -776,10 +776,9 @@ static int tsc2007_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -829,10 +828,9 @@ static int tsc2007_close(FAR struct file *filep)
|
||||
FAR struct tsc2007_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -872,10 +870,9 @@ static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer,
|
||||
struct tsc2007_sample_s sample;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
@ -1003,10 +1000,9 @@ static int tsc2007_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
iinfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver data structure */
|
||||
@ -1076,10 +1072,10 @@ static int tsc2007_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int i;
|
||||
|
||||
iinfo("setup: %d\n", (int)setup);
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct tsc2007_dev_s *)inode->i_private;
|
||||
|
||||
/* Are we setting up the poll? Or tearing it down? */
|
||||
|
@ -115,7 +115,6 @@ static ssize_t gpio_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct gpio_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
dev = inode->i_private;
|
||||
@ -174,7 +173,6 @@ static ssize_t gpio_write(FAR struct file *filep, FAR const char *buffer,
|
||||
int ret;
|
||||
bool val;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
dev = inode->i_private;
|
||||
@ -278,7 +276,6 @@ static int gpio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int i;
|
||||
int j = 0;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
dev = inode->i_private;
|
||||
|
@ -63,7 +63,6 @@ int ipcc_close(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
priv = filep->f_inode->i_private;
|
||||
|
||||
/* Get exclusive access to the IPCC driver state structure */
|
||||
|
@ -60,7 +60,6 @@ int ipcc_open(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
priv = filep->f_inode->i_private;
|
||||
|
||||
/* Get exclusive access to the IPCC driver state structure */
|
||||
|
@ -72,7 +72,6 @@ int ipcc_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
priv = filep->f_inode->i_private;
|
||||
|
||||
/* Get exclusive access to driver */
|
||||
|
@ -126,7 +126,6 @@ ssize_t ipcc_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
priv = filep->f_inode->i_private;
|
||||
|
||||
/* Get exclusive access to driver */
|
||||
|
@ -65,7 +65,6 @@ int ipcc_unlink(FAR struct inode *inode)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
priv = inode->i_private;
|
||||
|
||||
/* Get exclusive access to the IPCC driver state structure */
|
||||
|
@ -128,7 +128,6 @@ ssize_t ipcc_write(FAR struct file *filep, FAR const char *buffer,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
priv = filep->f_inode->i_private;
|
||||
|
||||
/* Get exclusive access to driver */
|
||||
|
@ -451,9 +451,8 @@ static int ft80x_open(FAR struct file *filep)
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = inode->i_private;
|
||||
|
||||
lcdinfo("crefs: %d\n", priv->crefs);
|
||||
@ -507,9 +506,8 @@ static int ft80x_close(FAR struct file *filep)
|
||||
FAR struct ft80x_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = inode->i_private;
|
||||
|
||||
lcdinfo("crefs: %d\n", priv->crefs);
|
||||
@ -583,9 +581,8 @@ static ssize_t ft80x_write(FAR struct file *filep, FAR const char *buffer,
|
||||
DEBUGASSERT(buffer != NULL && ((uintptr_t)buffer & 3) == 0 &&
|
||||
len > 0 && (len & 3) == 0 && len <= FT80X_RAM_DL_SIZE);
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = inode->i_private;
|
||||
|
||||
if (buffer == NULL || ((uintptr_t)buffer & 3) != 0 ||
|
||||
@ -632,9 +629,8 @@ static int ft80x_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct ft80x_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = inode->i_private;
|
||||
|
||||
lcdinfo("cmd: %d arg: %lu\n", cmd, arg);
|
||||
@ -1159,7 +1155,7 @@ static int ft80x_unlink(FAR struct inode *inode)
|
||||
* structure.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = inode->i_private;
|
||||
|
||||
/* Indicate that the driver has been unlinked */
|
||||
|
@ -823,7 +823,6 @@ static int tda19988_open(FAR struct file *filep)
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -866,7 +865,6 @@ static int tda19988_close(FAR struct file *filep)
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -923,7 +921,6 @@ static ssize_t tda19988_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -993,7 +990,6 @@ static off_t tda19988_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -1087,7 +1083,6 @@ static int tda19988_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -1166,7 +1161,6 @@ static int tda19988_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
@ -1209,7 +1203,7 @@ static int tda19988_unlink(FAR struct inode *inode)
|
||||
|
||||
/* Get the private driver state instance */
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct tda1988_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the driver */
|
||||
|
@ -122,7 +122,6 @@ static int userled_open(FAR struct file *filep)
|
||||
FAR struct userled_open_s *opriv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct userled_upperhalf_s *)inode->i_private;
|
||||
@ -177,7 +176,7 @@ static int userled_close(FAR struct file *filep)
|
||||
bool closing;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -262,7 +261,6 @@ static ssize_t userled_write(FAR struct file *filep, FAR const char *buffer,
|
||||
userled_set_t ledset;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct userled_upperhalf_s *)inode->i_private;
|
||||
@ -317,7 +315,7 @@ static int userled_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR const struct userled_lowerhalf_s *lower;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_priv != NULL &&
|
||||
DEBUGASSERT(filep->f_priv != NULL &&
|
||||
filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
@ -110,7 +110,7 @@ static int loop_open(FAR struct inode *inode)
|
||||
FAR struct loop_struct_s *dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct loop_struct_s *)inode->i_private;
|
||||
|
||||
/* Make sure we have exclusive access to the state structure */
|
||||
@ -147,7 +147,7 @@ static int loop_close(FAR struct inode *inode)
|
||||
FAR struct loop_struct_s *dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct loop_struct_s *)inode->i_private;
|
||||
|
||||
/* Make sure we have exclusive access to the state structure */
|
||||
@ -187,7 +187,7 @@ static ssize_t loop_read(FAR struct inode *inode, FAR unsigned char *buffer,
|
||||
off_t offset;
|
||||
off_t ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct loop_struct_s *)inode->i_private;
|
||||
|
||||
if (start_sector + nsectors > dev->nsectors)
|
||||
@ -241,7 +241,7 @@ static ssize_t loop_write(FAR struct inode *inode,
|
||||
off_t offset;
|
||||
off_t ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct loop_struct_s *)inode->i_private;
|
||||
|
||||
/* Calculate the offset to write the sectors and seek to the position */
|
||||
@ -284,7 +284,6 @@ static int loop_geometry(FAR struct inode *inode,
|
||||
{
|
||||
FAR struct loop_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
dev = (FAR struct loop_struct_s *)inode->i_private;
|
||||
|
@ -167,7 +167,7 @@ static int rd_open(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct rd_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
|
||||
/* Increment the open reference count */
|
||||
@ -192,7 +192,7 @@ static int rd_close(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct rd_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
|
||||
/* Increment the open reference count */
|
||||
@ -233,7 +233,7 @@ static ssize_t rd_read(FAR struct inode *inode, unsigned char *buffer,
|
||||
{
|
||||
FAR struct rd_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
@ -267,7 +267,7 @@ static ssize_t rd_write(FAR struct inode *inode, const unsigned char *buffer,
|
||||
{
|
||||
struct rd_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct rd_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
@ -306,7 +306,6 @@ static int rd_geometry(FAR struct inode *inode, struct geometry *geometry)
|
||||
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
dev = (struct rd_struct_s *)inode->i_private;
|
||||
@ -347,7 +346,7 @@ static int rd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
||||
|
||||
/* Only one ioctl command is supported */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
if (cmd == BIOC_XIPBASE && ppv)
|
||||
{
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
@ -373,7 +372,7 @@ static int rd_unlink(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct rd_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
|
||||
/* Mark the pipe unlinked */
|
||||
|
@ -200,10 +200,6 @@ static int rpmsgdev_open(FAR struct file *filep)
|
||||
struct rpmsgdev_open_s msg;
|
||||
int ret;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Get the mountpoint inode reference from the file structure and the
|
||||
* mountpoint private data from the inode structure
|
||||
*/
|
||||
@ -263,10 +259,6 @@ static int rpmsgdev_close(FAR struct file *filep)
|
||||
struct rpmsgdev_close_s msg;
|
||||
int ret;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
@ -405,10 +397,6 @@ static ssize_t rpmsgdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
@ -480,8 +468,6 @@ static ssize_t rpmsgdev_write(FAR struct file *filep, const char *buffer,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
@ -589,10 +575,6 @@ static off_t rpmsgdev_seek(FAR struct file *filep, off_t offset, int whence)
|
||||
struct rpmsgdev_lseek_s msg;
|
||||
int ret;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
@ -675,10 +657,6 @@ static int rpmsgdev_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
size_t msglen;
|
||||
int ret;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
@ -745,10 +723,6 @@ static int rpmsgdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
FAR struct rpmsgdev_priv_s *priv;
|
||||
struct rpmsgdev_poll_s msg;
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
|
||||
/* Recover our private data from the struct file instance */
|
||||
|
||||
dev = filep->f_inode->i_private;
|
||||
|
@ -2043,7 +2043,7 @@ static int mmcsd_open(FAR struct inode *inode)
|
||||
int ret;
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
|
||||
/* Just increment the reference count on the driver */
|
||||
@ -2074,7 +2074,7 @@ static int mmcsd_close(FAR struct inode *inode)
|
||||
int ret;
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
|
||||
/* Decrement the reference count on the block driver */
|
||||
@ -2109,7 +2109,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
|
||||
ssize_t nread;
|
||||
ssize_t ret = nsectors;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
finfo("startsector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
startsector, nsectors, priv->blocksize);
|
||||
@ -2187,7 +2187,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode,
|
||||
ssize_t nwrite;
|
||||
ssize_t ret = nsectors;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
finfo("startsector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
startsector, nsectors, priv->blocksize);
|
||||
@ -2259,7 +2259,7 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
|
||||
int ret = -EINVAL;
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
if (geometry)
|
||||
{
|
||||
@ -2321,7 +2321,7 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
|
||||
/* Process the IOCTL by command */
|
||||
|
@ -1127,7 +1127,6 @@ static int alt1250_open(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
dev = (FAR struct alt1250_dev_s *)inode->i_private;
|
||||
@ -1174,7 +1173,6 @@ static int alt1250_close(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
dev = (FAR struct alt1250_dev_s *)inode->i_private;
|
||||
@ -1220,7 +1218,6 @@ static ssize_t alt1250_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
dev = (FAR struct alt1250_dev_s *)inode->i_private;
|
||||
@ -1246,7 +1243,6 @@ static int alt1250_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
dev = (FAR struct alt1250_dev_s *)inode->i_private;
|
||||
@ -1311,7 +1307,6 @@ static int alt1250_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
dev = (FAR struct alt1250_dev_s *)inode->i_private;
|
||||
|
@ -296,7 +296,7 @@ static int dhara_open(FAR struct inode *inode)
|
||||
{
|
||||
FAR dhara_dev_t *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *) inode->i_private;
|
||||
nxmutex_lock(&dev->lock);
|
||||
dev->refs++;
|
||||
@ -316,7 +316,7 @@ static int dhara_close(FAR struct inode *inode)
|
||||
{
|
||||
FAR dhara_dev_t *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *) inode->i_private;
|
||||
nxmutex_lock(&dev->lock);
|
||||
dev->refs--;
|
||||
@ -349,7 +349,7 @@ static ssize_t dhara_read(FAR struct inode *inode,
|
||||
size_t nread = 0;
|
||||
int ret = 0;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&dev->lock);
|
||||
@ -393,7 +393,7 @@ static ssize_t dhara_write(FAR struct inode *inode,
|
||||
size_t nwrite = 0;
|
||||
int ret = 0;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *)inode->i_private;
|
||||
|
||||
nxmutex_lock(&dev->lock);
|
||||
@ -433,7 +433,7 @@ static int dhara_geometry(FAR struct inode *inode,
|
||||
{
|
||||
FAR dhara_dev_t *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *)inode->i_private;
|
||||
|
||||
if (geometry)
|
||||
@ -466,7 +466,7 @@ static int dhara_ioctl(FAR struct inode *inode,
|
||||
FAR dhara_dev_t *dev;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (dhara_dev_t *)inode->i_private;
|
||||
|
||||
/* No other block driver ioctl commands are not recognized by this
|
||||
@ -495,7 +495,7 @@ static int dhara_unlink(FAR struct inode *inode)
|
||||
{
|
||||
FAR dhara_dev_t *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR dhara_dev_t *)inode->i_private;
|
||||
nxmutex_lock(&dev->lock);
|
||||
dev->unlinked = true;
|
||||
|
@ -212,7 +212,7 @@ static int ftl_open(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct ftl_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct ftl_struct_s *)inode->i_private;
|
||||
|
||||
dev->refs++;
|
||||
@ -230,7 +230,7 @@ static int ftl_close(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct ftl_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct ftl_struct_s *)inode->i_private;
|
||||
|
||||
#ifdef CONFIG_FTL_WRITEBUFFER
|
||||
@ -442,7 +442,7 @@ static ssize_t ftl_read(FAR struct inode *inode, unsigned char *buffer,
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
dev = (FAR struct ftl_struct_s *)inode->i_private;
|
||||
#ifdef FTL_HAVE_RWBUFFER
|
||||
@ -660,7 +660,7 @@ static ssize_t ftl_write(FAR struct inode *inode,
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (struct ftl_struct_s *)inode->i_private;
|
||||
#ifdef FTL_HAVE_RWBUFFER
|
||||
return rwb_write(&dev->rwb, start_sector, nsectors, buffer);
|
||||
@ -683,7 +683,6 @@ static int ftl_geometry(FAR struct inode *inode,
|
||||
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
dev = (struct ftl_struct_s *)inode->i_private;
|
||||
@ -720,7 +719,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
dev = (struct ftl_struct_s *)inode->i_private;
|
||||
|
||||
@ -757,7 +756,7 @@ static int ftl_unlink(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct ftl_struct_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct ftl_struct_s *)inode->i_private;
|
||||
|
||||
dev->unlinked = true;
|
||||
|
@ -903,7 +903,7 @@ static ssize_t smart_read(FAR struct inode *inode, unsigned char *buffer,
|
||||
finfo("SMART: sector: %" PRIuOFF " nsectors: %u\n",
|
||||
start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
dev = ((FAR struct smart_multiroot_device_s *)inode->i_private)->dev;
|
||||
#else
|
||||
@ -939,7 +939,7 @@ static ssize_t smart_write(FAR struct inode *inode,
|
||||
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
dev = ((FAR struct smart_multiroot_device_s *)inode->i_private)->dev;
|
||||
#else
|
||||
@ -1049,7 +1049,6 @@ static int smart_geometry(FAR struct inode *inode, struct geometry *geometry)
|
||||
|
||||
finfo("Entry\n");
|
||||
|
||||
DEBUGASSERT(inode);
|
||||
if (geometry)
|
||||
{
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
@ -5483,7 +5482,7 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
||||
#endif
|
||||
|
||||
finfo("Entry\n");
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
dev = ((FAR struct smart_multiroot_device_s *)inode->i_private)->dev;
|
||||
|
@ -887,7 +887,7 @@ int pipecommon_unlink(FAR struct inode *inode)
|
||||
{
|
||||
FAR struct pipe_dev_s *dev;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
dev = (FAR struct pipe_dev_s *)inode->i_private;
|
||||
|
||||
/* Mark the pipe unlinked */
|
||||
|
@ -84,7 +84,6 @@ static int relay_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct inode *inode;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
dev = inode->i_private;
|
||||
|
@ -82,10 +82,9 @@ static ssize_t adxl345_read(FAR struct file *filep,
|
||||
int ret;
|
||||
|
||||
sninfo("len=%d\n", len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct adxl345_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
|
@ -534,7 +534,7 @@ static int aht10_unlink(FAR struct inode *inode)
|
||||
FAR struct aht10_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct aht10_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -2037,12 +2037,10 @@ static ssize_t apds9922_als_read(FAR struct file *filep, FAR char *buffer,
|
||||
int *ptr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
|
||||
inode = filep->f_inode;
|
||||
priv = inode->i_private;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
if (ret < 0)
|
||||
@ -2183,10 +2181,10 @@ static int apds9922_als_poll(FAR struct file *filep,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct apds9922_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
@ -2272,9 +2270,7 @@ static ssize_t apds9922_ps_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct apds9922_ps_data *ptr;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
||||
if (buflen < sizeof(struct apds9922_ps_data))
|
||||
{
|
||||
@ -2410,10 +2406,10 @@ static int apds9922_ps_poll(FAR struct file *filep,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct apds9922_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->devlock);
|
||||
|
@ -1134,10 +1134,9 @@ static ssize_t apds9960_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct apds9960_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct apds9960_dev_s *)inode->i_private;
|
||||
|
||||
/* Check if the user is reading the right size */
|
||||
|
@ -177,10 +177,9 @@ static ssize_t bh1750fvi_read(FAR struct file *filep, FAR char *buffer,
|
||||
FAR struct bh1750fvi_dev_s *priv;
|
||||
uint16_t lux = 0;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct bh1750fvi_dev_s *)inode->i_private;
|
||||
|
||||
/* Check if the user is reading the right size */
|
||||
|
@ -197,7 +197,6 @@ static int gps_open(FAR struct file *filep)
|
||||
FAR struct gps_user_s *user;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
upper = filep->f_inode->i_private;
|
||||
|
||||
user = kmm_zalloc(sizeof(struct gps_user_s));
|
||||
@ -242,7 +241,7 @@ static int gps_close(FAR struct file *filep)
|
||||
FAR struct gps_user_s *user;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL && filep->f_priv);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
upper = filep->f_inode->i_private;
|
||||
user = filep->f_priv;
|
||||
|
||||
@ -280,7 +279,6 @@ static ssize_t gps_read(FAR struct file *filep, FAR char *buffer,
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
upper = filep->f_inode->i_private;
|
||||
user = filep->f_priv;
|
||||
|
||||
@ -327,7 +325,6 @@ static ssize_t gps_write(FAR struct file *filep, FAR const char *buffer,
|
||||
FAR struct gps_upperhalf_s *upper;
|
||||
int ret = -ENOTSUP;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
upper = filep->f_inode->i_private;
|
||||
|
||||
nxmutex_lock(&upper->lock);
|
||||
@ -346,7 +343,6 @@ static int gps_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct gps_upperhalf_s *upper;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
upper = filep->f_inode->i_private;
|
||||
|
||||
nxmutex_lock(&upper->lock);
|
||||
@ -374,7 +370,6 @@ static int gps_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
FAR struct gps_user_s *user;
|
||||
ssize_t ret = OK;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
upper = filep->f_inode->i_private;
|
||||
user = filep->f_priv;
|
||||
|
||||
|
@ -280,10 +280,10 @@ static int hcsr04_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct hcsr04_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -598,8 +598,6 @@ static ssize_t hdc1008_read(FAR struct file *filep, FAR char *buffer,
|
||||
int len = 0;
|
||||
struct hdc1008_conv_data_s data;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
|
||||
/* Sanity check of input buffer argument */
|
||||
|
||||
if (buffer == NULL)
|
||||
|
@ -1063,10 +1063,10 @@ static int hts221_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct hts221_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -480,7 +480,7 @@ static ssize_t kxtj9_read(FAR struct file *filep, FAR char *buffer,
|
||||
return (ssize_t)-EINVAL;
|
||||
}
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL && buffer != NULL);
|
||||
DEBUGASSERT(buffer != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct kxtj9_dev_s *)inode->i_private;
|
||||
@ -538,7 +538,6 @@ static int kxtj9_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct kxtj9_dev_s *)inode->i_private;
|
||||
|
@ -517,7 +517,7 @@ static ssize_t lis2dh_read(FAR struct file *filep, FAR char *buffer,
|
||||
static ssize_t lis2dh_write(FAR struct file *filep, FAR const char *buffer,
|
||||
size_t buflen)
|
||||
{
|
||||
DEBUGASSERT(filep != NULL && buffer != NULL && buflen > 0);
|
||||
DEBUGASSERT(buffer != NULL && buflen > 0);
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
@ -538,10 +538,9 @@ static int lis2dh_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
uint8_t buf;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct lis2dh_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&dev->devlock);
|
||||
@ -665,10 +664,10 @@ static int lis2dh_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct lis2dh_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&dev->devlock);
|
||||
|
@ -954,10 +954,8 @@ static ssize_t lsm303agr_read(FAR struct file *filep,
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm303agr_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -1077,10 +1075,8 @@ static int lsm303agr_ioctl(FAR struct file *filep, int cmd,
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm303agr_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
@ -977,10 +977,8 @@ static ssize_t lsm6dsl_read(FAR struct file *filep,
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm6dsl_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -1099,10 +1097,8 @@ static int lsm6dsl_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm6dsl_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
@ -1216,10 +1216,8 @@ static ssize_t lsm9ds1_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm9ds1_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -1339,10 +1337,8 @@ static int lsm9ds1_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct lsm9ds1_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
@ -215,10 +215,9 @@ static int max44009_open(FAR struct file *filep)
|
||||
unsigned int use_count;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max44009_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->dev_lock);
|
||||
@ -264,10 +263,9 @@ static int max44009_close(FAR struct file *filep)
|
||||
int use_count;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max44009_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->dev_lock);
|
||||
@ -307,10 +305,9 @@ static ssize_t max44009_read(FAR struct file *filep, FAR char *buffer,
|
||||
int ret;
|
||||
struct max44009_data_s data;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max44009_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->dev_lock);
|
||||
@ -711,10 +708,9 @@ static int max44009_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct max44009_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max44009_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->dev_lock);
|
||||
@ -783,10 +779,10 @@ static int max44009_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret = OK;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep && fds);
|
||||
DEBUGASSERT(fds);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct max44009_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->dev_lock);
|
||||
|
@ -260,10 +260,9 @@ static ssize_t mlx90614_read(FAR struct file *filep, FAR char *buffer,
|
||||
uint8_t cmd;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct mlx90614_dev_s *)inode->i_private;
|
||||
|
||||
/* Check if the user is reading the right size */
|
||||
|
@ -479,10 +479,8 @@ static int msa301_open(FAR struct file *filep)
|
||||
FAR struct inode * inode;
|
||||
FAR struct msa301_dev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct msa301_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -507,10 +505,8 @@ static int msa301_close(FAR struct file *filep)
|
||||
FAR struct inode * inode;
|
||||
FAR struct msa301_dev_s *priv;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct msa301_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -539,10 +535,8 @@ static ssize_t msa301_read(FAR struct file *filep,
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct msa301_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
@ -593,10 +587,8 @@ static int msa301_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Sanity check */
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
priv = (FAR struct msa301_dev_s *)inode->i_private;
|
||||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
@ -982,7 +982,7 @@ static int scd30_unlink(FAR struct inode *inode)
|
||||
FAR struct scd30_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct scd30_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -939,7 +939,7 @@ static int scd41_unlink(FAR struct inode *inode)
|
||||
FAR struct scd41_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct scd41_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -989,7 +989,7 @@ static int sgp30_unlink(FAR struct inode *inode)
|
||||
FAR struct sgp30_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct sgp30_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -591,7 +591,7 @@ static int sht21_unlink(FAR struct inode *inode)
|
||||
FAR struct sht21_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct sht21_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -610,7 +610,7 @@ static int sht3x_unlink(FAR struct inode *inode)
|
||||
FAR struct sht3x_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct sht3x_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -1000,7 +1000,7 @@ static int sps30_unlink(FAR struct inode *inode)
|
||||
FAR struct sps30_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct sps30_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access */
|
||||
|
@ -175,10 +175,9 @@ static ssize_t veml6070_read(FAR struct file *filep, FAR char *buffer,
|
||||
int msb = 1;
|
||||
uint16_t regdata;
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct veml6070_dev_s *)inode->i_private;
|
||||
|
||||
/* Check if the user is reading the right size */
|
||||
|
@ -101,10 +101,9 @@ static ssize_t xen1210_read(FAR struct file *filep, FAR char *buffer,
|
||||
int ret;
|
||||
|
||||
sninfo("len=%d\n", len);
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct xen1210_dev_s *)inode->i_private;
|
||||
|
||||
/* Verify that the caller has provided a buffer large enough to receive
|
||||
|
@ -200,7 +200,6 @@ static int zc_open(FAR struct file *filep)
|
||||
FAR struct zc_open_s *opriv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_inode);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct zc_upperhalf_s *)inode->i_private;
|
||||
@ -258,7 +257,7 @@ static int zc_close(FAR struct file *filep)
|
||||
bool closing;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
@ -386,7 +385,7 @@ static int zc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
int ret;
|
||||
|
||||
sninfo("cmd: %d arg: %ld\n", cmd, arg);
|
||||
DEBUGASSERT(filep && filep->f_priv && filep->f_inode);
|
||||
DEBUGASSERT(filep->f_priv);
|
||||
opriv = filep->f_priv;
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode->i_private);
|
||||
|
@ -231,7 +231,6 @@ static int pty_open(FAR struct file *filep)
|
||||
FAR struct pty_devpair_s *devpair;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL && dev->pd_devpair != NULL);
|
||||
@ -328,7 +327,6 @@ static int pty_close(FAR struct file *filep)
|
||||
FAR struct pty_devpair_s *devpair;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL && dev->pd_devpair != NULL);
|
||||
@ -400,7 +398,6 @@ static ssize_t pty_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
ssize_t j;
|
||||
char ch;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL);
|
||||
@ -555,7 +552,6 @@ static ssize_t pty_write(FAR struct file *filep,
|
||||
size_t i;
|
||||
char ch;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL);
|
||||
@ -665,7 +661,6 @@ static int pty_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
FAR struct pty_devpair_s *devpair;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
DEBUGASSERT(dev != NULL && dev->pd_devpair != NULL);
|
||||
@ -854,7 +849,6 @@ static int pty_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
dev = inode->i_private;
|
||||
devpair = dev->pd_devpair;
|
||||
@ -943,7 +937,7 @@ static int pty_unlink(FAR struct inode *inode)
|
||||
FAR struct pty_devpair_s *devpair;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
dev = inode->i_private;
|
||||
devpair = dev->pd_devpair;
|
||||
DEBUGASSERT(dev->pd_devpair != NULL);
|
||||
|
@ -124,7 +124,6 @@ static int spidrvr_open(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct spi_driver_s *)inode->i_private;
|
||||
@ -161,7 +160,6 @@ static int spidrvr_close(FAR struct file *filep)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct spi_driver_s *)inode->i_private;
|
||||
@ -231,7 +229,6 @@ static int spidrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
|
||||
priv = (FAR struct spi_driver_s *)inode->i_private;
|
||||
@ -293,7 +290,7 @@ static int spidrvr_unlink(FAR struct inode *inode)
|
||||
|
||||
/* Get our private data structure */
|
||||
|
||||
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
priv = (FAR struct spi_driver_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the SPI driver state structure */
|
||||
|
@ -175,8 +175,6 @@ static int spi_slave_open(FAR struct file *filep)
|
||||
FAR struct spi_slave_driver_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
DEBUGASSERT(filep->f_inode->i_private != NULL);
|
||||
|
||||
spiinfo("filep: %p\n", filep);
|
||||
@ -225,8 +223,6 @@ static int spi_slave_close(FAR struct file *filep)
|
||||
FAR struct spi_slave_driver_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(filep != NULL);
|
||||
DEBUGASSERT(filep->f_inode != NULL);
|
||||
DEBUGASSERT(filep->f_inode->i_private != NULL);
|
||||
|
||||
spiinfo("filep: %p\n", filep);
|
||||
@ -514,7 +510,6 @@ static int spi_slave_unlink(FAR struct inode *inode)
|
||||
FAR struct spi_slave_driver_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode != NULL);
|
||||
DEBUGASSERT(inode->i_private != NULL);
|
||||
|
||||
/* Get our private data structure */
|
||||
|
@ -460,7 +460,7 @@ static ssize_t ramlog_file_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
/* Some sanity checking */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ramlog_dev_s *)inode->i_private;
|
||||
|
||||
/* If the circular buffer is empty, then wait for something to be written
|
||||
@ -622,7 +622,7 @@ static ssize_t ramlog_file_write(FAR struct file *filep,
|
||||
|
||||
/* Some sanity checking */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ramlog_dev_s *)inode->i_private;
|
||||
|
||||
return ramlog_addbuf(priv, buffer, len);
|
||||
@ -639,7 +639,7 @@ static int ramlog_file_ioctl(FAR struct file *filep, int cmd,
|
||||
FAR struct ramlog_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ramlog_dev_s *)inode->i_private;
|
||||
|
||||
ret = nxmutex_lock(&priv->rl_lock);
|
||||
@ -679,7 +679,7 @@ static int ramlog_file_poll(FAR struct file *filep, FAR struct pollfd *fds,
|
||||
|
||||
/* Some sanity checking */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct ramlog_dev_s *)inode->i_private;
|
||||
|
||||
/* Get exclusive access to the poll structures */
|
||||
|
@ -304,7 +304,7 @@ static ssize_t syslog_rpmsg_file_read(FAR struct file *filep,
|
||||
|
||||
/* Some sanity checking */
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
priv = (FAR struct syslog_rpmsg_s *)inode->i_private;
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
@ -120,7 +120,6 @@ static ssize_t oneshot_read(FAR struct file *filep, FAR char *buffer,
|
||||
/* Return zero -- usually meaning end-of-file */
|
||||
|
||||
tmrinfo("buflen=%ld\n", (unsigned long)buflen);
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -138,7 +137,6 @@ static ssize_t oneshot_write(FAR struct file *filep, FAR const char *buffer,
|
||||
/* Return a failure */
|
||||
|
||||
tmrinfo("buflen=%ld\n", (unsigned long)buflen);
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
@ -158,7 +156,6 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
|
||||
tmrinfo("cmd=%d arg=%08lx\n", cmd, (unsigned long)arg);
|
||||
|
||||
DEBUGASSERT(filep != NULL && filep->f_inode != NULL);
|
||||
inode = filep->f_inode;
|
||||
priv = (FAR struct oneshot_dev_s *)inode->i_private;
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
@ -240,9 +240,8 @@ static int rtc_open(FAR struct file *filep)
|
||||
* structure.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
upper = inode->i_private;
|
||||
|
||||
/* Get exclusive access to the device structures */
|
||||
@ -277,9 +276,8 @@ static int rtc_close(FAR struct file *filep)
|
||||
* structure.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
upper = inode->i_private;
|
||||
|
||||
/* Get exclusive access to the device structures */
|
||||
@ -343,9 +341,8 @@ static int rtc_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
* structure.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(filep);
|
||||
inode = filep->f_inode;
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
upper = inode->i_private;
|
||||
DEBUGASSERT(upper->lower && upper->lower->ops);
|
||||
|
||||
@ -766,7 +763,7 @@ static int rtc_unlink(FAR struct inode *inode)
|
||||
* structure.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
DEBUGASSERT(inode->i_private);
|
||||
upper = inode->i_private;
|
||||
|
||||
/* Get exclusive access to the device structures */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user