diff --git a/drivers/sensors/Kconfig b/drivers/sensors/Kconfig index b5fc76cb41..03911022b5 100644 --- a/drivers/sensors/Kconfig +++ b/drivers/sensors/Kconfig @@ -201,6 +201,7 @@ config MS58XX_I2C_FREQUENCY config MS58XX_VDD int "MEAS MS58XX VDD" default 30 + depends on MS58XX config MPL115A bool "Freescale MPL115A Barometer Sensor support" diff --git a/drivers/sensors/hts221.c b/drivers/sensors/hts221.c index 59c5790ad5..9f3138bddf 100644 --- a/drivers/sensors/hts221.c +++ b/drivers/sensors/hts221.c @@ -201,10 +201,10 @@ static int hts221_do_transfer(FAR struct hts221_dev_s *priv, break; } - ret = up_i2creset(priv->i2c); + ret = I2C_RESET(priv->i2c); if (ret < 0) { - hts221_dbg("up_i2creset failed: %d\n", ret); + hts221_dbg("I2C_RESET failed: %d\n", ret); return ret; } #endif @@ -892,7 +892,7 @@ static int hts221_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { FAR struct inode *inode = filep->f_inode; FAR struct hts221_dev_s *priv = inode->i_private; - int32_t ret = 0; + int ret = OK; while (sem_wait(&priv->devsem) != 0) { @@ -932,7 +932,7 @@ static int hts221_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; default: - ret = -EINVAL; + ret = -ENOTTY; break; } diff --git a/drivers/sensors/lis2dh.c b/drivers/sensors/lis2dh.c index b24aa782e3..f7a982f151 100644 --- a/drivers/sensors/lis2dh.c +++ b/drivers/sensors/lis2dh.c @@ -131,9 +131,11 @@ static int lis2dh_get_reading(FAR struct lis2dh_dev_s *dev, FAR struct lis2dh_vector_s *res, bool force_read); static int lis2dh_powerdown(FAR struct lis2dh_dev_s *dev); static int lis2dh_reboot(FAR struct lis2dh_dev_s *dev); +#ifndef CONFIG_DISABLE_POLL static int lis2dh_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup); static void lis2dh_notify(FAR struct lis2dh_dev_s *priv); +#endif static int lis2dh_int_handler(int irq, FAR void *context, FAR void *arg); static int lis2dh_setup(FAR struct lis2dh_dev_s *dev, @@ -1614,10 +1616,10 @@ static int lis2dh_access(FAR struct lis2dh_dev_s *dev, uint8_t subaddr, { /* Some error. Try to reset I2C bus and keep trying. */ #ifdef CONFIG_I2C_RESET - int ret = up_i2creset(dev->i2c); + int ret = I2C_RESET(dev->i2c); if (ret < 0) { - lis2dh_dbg("up_i2creset failed: %d\n", ret); + lis2dh_dbg("I2C_RESET failed: %d\n", ret); return ret; } #endif diff --git a/drivers/sensors/lps25h.c b/drivers/sensors/lps25h.c index 3ebba98285..bd35f38043 100644 --- a/drivers/sensors/lps25h.c +++ b/drivers/sensors/lps25h.c @@ -257,10 +257,10 @@ static int lps25h_do_transfer(FAR struct lps25h_dev_s *dev, break; } - ret = up_i2creset(dev->i2c); + ret = I2C_RESET(dev->i2c); if (ret < 0) { - lps25h_dbg("up_i2creset failed: %d\n", ret); + lps25h_dbg("I2C_RESET failed: %d\n", ret); return ret; } #endif @@ -708,7 +708,7 @@ static int lps25h_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { FAR struct inode *inode = filep->f_inode; FAR struct lps25h_dev_s *dev = inode->i_private; - int ret = 0; + int ret = OK; while (sem_wait(&dev->devsem) != 0) { @@ -742,7 +742,7 @@ static int lps25h_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; default: - ret = -EINVAL; + ret = -ENOTTY; break; } diff --git a/drivers/usbmisc/fusb301.c b/drivers/usbmisc/fusb301.c index c3627fd909..f24ae78558 100644 --- a/drivers/usbmisc/fusb301.c +++ b/drivers/usbmisc/fusb301.c @@ -176,10 +176,10 @@ static int fusb301_getreg(FAR struct fusb301_dev_s *priv, uint8_t reg) break; } - ret = up_i2creset(priv->i2c); + ret = I2C_RESET(priv->i2c); if (ret < 0) { - fusb301_err("ERROR: up_i2creset failed: %d\n", ret); + fusb301_err("ERROR: I2C_RESET failed: %d\n", ret); return ret; } #endif @@ -246,10 +246,10 @@ static int fusb301_putreg(FAR struct fusb301_dev_s *priv, uint8_t regaddr, break; } - ret = up_i2creset(priv->i2c); + ret = I2C_RESET(priv->i2c); if (ret < 0) { - fusb301_err("ERROR: up_i2creset failed: %d\n", ret); + fusb301_err("ERROR: I2C_RESET failed: %d\n", ret); return ret; } #endif