drivers: Replace DEV_USED by -EBUSY

This patch replaces all occurences of the macro DEV_USED by -EBUSY
at the driver level. So this patch touch the files under drivers/,
include/ and samples/drivers/ when applicable.

This patch is part of the effort to transition from DEV_* codes to
errno.h codes.

Change-Id: I21eb3ffe9bdfde98593dcf63c50a8bdcd376e49e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This commit is contained in:
Andre Guedes 2016-03-09 15:26:12 -03:00 committed by Anas Nashif
commit afcc923172
6 changed files with 8 additions and 8 deletions

View file

@ -145,7 +145,7 @@ static int i2c_qmsi_transfer(struct device *dev, struct i2c_msg *msgs,
qm_rc_t rc; qm_rc_t rc;
if (qm_i2c_get_status(instance) != QM_I2C_IDLE) if (qm_i2c_get_status(instance) != QM_I2C_IDLE)
return DEV_USED; return -EBUSY;
if (msgs == NULL || num_msgs == 0) if (msgs == NULL || num_msgs == 0)
return -ENOTSUP; return -ENOTSUP;

View file

@ -443,7 +443,7 @@ static int i2c_qse_ss_intr_transfer(struct device *dev,
/* First step, check if device is idle */ /* First step, check if device is idle */
if (_i2c_qse_ss_is_busy(dev) || (dw->state & I2C_QSE_SS_BUSY)) { if (_i2c_qse_ss_is_busy(dev) || (dw->state & I2C_QSE_SS_BUSY)) {
return DEV_USED; return -EBUSY;
} }
dw->state |= I2C_QSE_SS_BUSY; dw->state |= I2C_QSE_SS_BUSY;

View file

@ -211,7 +211,7 @@ static int spi_dw_configure(struct device *dev,
/* Check status */ /* Check status */
if (!_spi_dw_is_controller_ready(dev)) { if (!_spi_dw_is_controller_ready(dev)) {
DBG("%s: Controller is busy\n", __func__); DBG("%s: Controller is busy\n", __func__);
return DEV_USED; return -EBUSY;
} }
/* Word size */ /* Word size */
@ -272,7 +272,7 @@ static int spi_dw_transceive(struct device *dev,
/* Check status */ /* Check status */
if (!_spi_dw_is_controller_ready(dev)) { if (!_spi_dw_is_controller_ready(dev)) {
DBG("%s: Controller is busy\n", __func__); DBG("%s: Controller is busy\n", __func__);
return DEV_USED; return -EBUSY;
} }
/* Set buffers info */ /* Set buffers info */

View file

@ -219,7 +219,7 @@ static int spi_intel_configure(struct device *dev,
/* Check status */ /* Check status */
if (test_bit_sscr0_sse(info->regs) && test_bit_sssr_bsy(info->regs)) { if (test_bit_sscr0_sse(info->regs) && test_bit_sssr_bsy(info->regs)) {
DBG("spi_intel_configure: Controller is busy\n"); DBG("spi_intel_configure: Controller is busy\n");
return DEV_USED; return -EBUSY;
} }
/* Pre-configuring the registers to a clean state*/ /* Pre-configuring the registers to a clean state*/
@ -277,7 +277,7 @@ static int spi_intel_transceive(struct device *dev,
/* Check status */ /* Check status */
if (test_bit_sscr0_sse(info->regs) && test_bit_sssr_bsy(info->regs)) { if (test_bit_sscr0_sse(info->regs) && test_bit_sssr_bsy(info->regs)) {
DBG("spi_intel_transceive: Controller is busy\n"); DBG("spi_intel_transceive: Controller is busy\n");
return DEV_USED; return -EBUSY;
} }
/* Set buffers info */ /* Set buffers info */

View file

@ -601,7 +601,7 @@ static int spi_k64_transceive(struct device *dev,
((sys_read32(info->regs + SPI_K64_REG_SR) & SPI_K64_SR_TFFF) == 0)) { ((sys_read32(info->regs + SPI_K64_REG_SR) & SPI_K64_SR_TFFF) == 0)) {
DBG("spi_k64_transceive: Tx FIFO is already full\n"); DBG("spi_k64_transceive: Tx FIFO is already full\n");
return DEV_USED; return -EBUSY;
} }
/* Set buffers info */ /* Set buffers info */

View file

@ -170,7 +170,7 @@ static int spi_qmsi_transceive(struct device *dev,
qm_rc_t rc; qm_rc_t rc;
if (pending_transfers[spi].dev) if (pending_transfers[spi].dev)
return DEV_USED; return -EBUSY;
pending_transfers[spi].dev = dev; pending_transfers[spi].dev = dev;
xfer = &pending_transfers[spi].xfer; xfer = &pending_transfers[spi].xfer;