drivers: Replace DEV_NOT_CONFIG by -EPERM

This patch replaces all occurences of the macro DEV_NOT_CONFIG by
-EPERM at the driver level. This patch is part of the effort to
transition from DEV_* codes to errno.h codes.

Change-Id: I3054c8aa76319a58a2eec089b8a72bf301c85391
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This commit is contained in:
Andre Guedes 2016-03-10 11:31:02 -03:00 committed by Anas Nashif
commit 136d171588
10 changed files with 20 additions and 13 deletions

View file

@ -223,7 +223,7 @@ int ti_adc108s102_init(struct device *dev)
adc->spi = device_get_binding((char *)config->spi_port); adc->spi = device_get_binding((char *)config->spi_port);
if (!adc->spi) { if (!adc->spi) {
return DEV_NOT_CONFIG; return -EPERM;
} }
DBG("ADC108s102 initialized\n"); DBG("ADC108s102 initialized\n");

View file

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include <errno.h>
#include <nanokernel.h> #include <nanokernel.h>
#include <sys_io.h> #include <sys_io.h>
#include <board.h> #include <board.h>
@ -207,7 +209,7 @@ static int eth_initialize(struct device *port)
} mac_addr; } mac_addr;
if (!eth_setup(port)) if (!eth_setup(port))
return DEV_NOT_CONFIG; return -EPERM;
base_addr = config->base_addr; base_addr = config->base_addr;

View file

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include <errno.h>
#include <nanokernel.h> #include <nanokernel.h>
#include <gpio.h> #include <gpio.h>
#include "gpio_dw.h" #include "gpio_dw.h"
@ -390,7 +392,7 @@ int gpio_dw_initialize(struct device *port)
uint32_t base_addr; uint32_t base_addr;
if (!gpio_dw_setup(port)) { if (!gpio_dw_setup(port)) {
return DEV_NOT_CONFIG; return -EPERM;
} }
base_addr = config->base_addr; base_addr = config->base_addr;

View file

@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include <errno.h>
#include <nanokernel.h> #include <nanokernel.h>
#include <arch/cpu.h> #include <arch/cpu.h>
@ -285,7 +288,7 @@ int glcd_initialize(struct device *port)
CONFIG_GROVE_LCD_RGB_I2C_MASTER_DEV_NAME); CONFIG_GROVE_LCD_RGB_I2C_MASTER_DEV_NAME);
if (!dev->i2c) { if (!dev->i2c) {
return DEV_NOT_CONFIG; return -EPERM;
} }
/* /*

View file

@ -686,7 +686,7 @@ int i2c_dw_initialize(struct device *port)
volatile struct i2c_dw_registers *regs; volatile struct i2c_dw_registers *regs;
if (!i2c_dw_pci_setup(port)) { if (!i2c_dw_pci_setup(port)) {
return DEV_NOT_CONFIG; return -EPERM;
} }
device_sync_call_init(&dev->sync); device_sync_call_init(&dev->sync);
@ -698,7 +698,7 @@ int i2c_dw_initialize(struct device *port)
port->driver_api = NULL; port->driver_api = NULL;
DBG("I2C: DesignWare magic key not found, check base address."); DBG("I2C: DesignWare magic key not found, check base address.");
DBG(" Stopping initialization\n"); DBG(" Stopping initialization\n");
return DEV_NOT_CONFIG; return -EPERM;
} }
port->driver_api = &funcs; port->driver_api = &funcs;
@ -721,7 +721,7 @@ int i2c_dw_initialize(struct device *port)
if (i2c_dw_runtime_configure(port, dev->app_config.raw) != 0) { if (i2c_dw_runtime_configure(port, dev->app_config.raw) != 0) {
DBG("I2C: Cannot set default configuration 0x%x\n", DBG("I2C: Cannot set default configuration 0x%x\n",
dev->app_config.raw); dev->app_config.raw);
return DEV_NOT_CONFIG; return -EPERM;
} }
dev->state = I2C_DW_STATE_READY; dev->state = I2C_DW_STATE_READY;

View file

@ -635,7 +635,7 @@ int i2c_qse_ss_initialize(struct device *dev)
if (i2c_qse_ss_runtime_configure(dev, dw->app_config.raw) != 0) { if (i2c_qse_ss_runtime_configure(dev, dw->app_config.raw) != 0) {
DBG("I2C_SS: Cannot set default configuration 0x%x\n", DBG("I2C_SS: Cannot set default configuration 0x%x\n",
dw->app_config.raw); dw->app_config.raw);
return DEV_NOT_CONFIG; return -EPERM;
} }
dw->state = I2C_QSE_SS_STATE_READY; dw->state = I2C_QSE_SS_STATE_READY;

View file

@ -198,7 +198,7 @@ static int _fsl_k64_set_pin(struct device *dev,
if (status != 0) { if (status != 0) {
return status; return status;
} else if (gpio_dev == NULL) { } else if (gpio_dev == NULL) {
return DEV_NOT_CONFIG; return -EPERM;
} }
if (func & K64_PINMUX_GPIO_DIR_OUTPUT) { if (func & K64_PINMUX_GPIO_DIR_OUTPUT) {
@ -265,7 +265,7 @@ static int _fsl_k64_get_pin(struct device *dev,
if (status != 0) { if (status != 0) {
return status; return status;
} else if (gpio_dev == NULL) { } else if (gpio_dev == NULL) {
return DEV_NOT_CONFIG; return -EPERM;
} }
cfg = gpio_dev->config->config_info; cfg = gpio_dev->config->config_info;

View file

@ -214,7 +214,7 @@ int pwm_pca9685_init(struct device *dev)
ret = i2c_write(i2c_master, buf, 2, config->i2c_slave_addr); ret = i2c_write(i2c_master, buf, 2, config->i2c_slave_addr);
if (ret != 0) { if (ret != 0) {
return DEV_NOT_CONFIG; return -EPERM;
} }
return 0; return 0;

View file

@ -382,7 +382,7 @@ int spi_dw_init(struct device *dev)
#ifndef CONFIG_SOC_QUARK_SE_SS #ifndef CONFIG_SOC_QUARK_SE_SS
if (read_ssi_comp_version(info->regs) != DW_SSI_COMP_VERSION) { if (read_ssi_comp_version(info->regs) != DW_SSI_COMP_VERSION) {
_clock_off(dev); _clock_off(dev);
return DEV_NOT_CONFIG; return -EPERM;
} }
#endif #endif

View file

@ -406,7 +406,7 @@ int spi_intel_init(struct device *dev)
dev->driver_api = &intel_spi_api; dev->driver_api = &intel_spi_api;
if (!spi_intel_setup(dev)) { if (!spi_intel_setup(dev)) {
return DEV_NOT_CONFIG; return -EPERM;
} }
info->config_func(); info->config_func();