From 193ff349ee87622dc200d3744f45938549971fbb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 30 Apr 2017 08:02:38 -0600 Subject: [PATCH] drivers/i2c: Fix compile issus if CONFIG_DISABLE_PSEUDOFS_OPERATIONS is enabeld. --- drivers/i2c/i2c_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/i2c_driver.c b/drivers/i2c/i2c_driver.c index 1e5024b3ec8..79f3bb98e66 100644 --- a/drivers/i2c/i2c_driver.c +++ b/drivers/i2c/i2c_driver.c @@ -82,8 +82,10 @@ struct i2c_driver_s * Private Function Prototypes ****************************************************************************/ +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS static int i2cdrvr_open(FAR struct file *filep); static int i2cdrvr_close(FAR struct file *filep); +#endif static ssize_t i2cdrvr_read(FAR struct file *filep, FAR char *buffer, size_t buflen); static ssize_t i2cdrvr_write(FAR struct file *filep, FAR const char *buffer, @@ -253,6 +255,7 @@ static int i2cdrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) priv = (FAR struct i2c_driver_s *)inode->i_private; DEBUGASSERT(priv); +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS /* Get exclusive access to the I2C driver state structure */ ret = sem_wait(&priv->exclsem); @@ -262,6 +265,7 @@ static int i2cdrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) DEBUGASSERT(errcode < 0); return -errcode; } +#endif /* Process the IOCTL command */ @@ -306,7 +310,9 @@ static int i2cdrvr_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; } +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS sem_post(&priv->exclsem); +#endif return ret; }