diff options
author | Simon Glass <sjg@chromium.org> | 2017-09-17 16:54:53 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-10-08 20:41:09 -0600 |
commit | 7c84319af9c76084f50f3f2b97545bfa05f3971d (patch) | |
tree | b4bad5c9afc2ca9dbd59778e306e11b4a34786c2 /drivers/gpio/atmel_pio4.c | |
parent | 4d686041895a8fd419bbc3842856239c6298d1f2 (diff) | |
download | u-boot-7c84319af9c76084f50f3f2b97545bfa05f3971d.tar.gz |
dm: gpio: Correct use of -ENODEV in drivers
In U-Boot -ENODEV means that there is no device. When there is a problem
with the device, drivers should return an error like -ENXIO or -EREMOTEIO.
When the device tree properties cannot be read correct , they should
return -EINVAL.
Update various GPIO drivers to follow this rule, to help with consistency
for future driver writers.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Adam Ford <aford173@gmail.com>
Diffstat (limited to 'drivers/gpio/atmel_pio4.c')
-rw-r--r-- | drivers/gpio/atmel_pio4.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpio/atmel_pio4.c b/drivers/gpio/atmel_pio4.c index f3689467f0..30bc4296e3 100644 --- a/drivers/gpio/atmel_pio4.c +++ b/drivers/gpio/atmel_pio4.c @@ -50,11 +50,11 @@ static int atmel_pio4_config_io_func(u32 port, u32 pin, u32 reg, mask; if (pin >= ATMEL_PIO_NPINS_PER_BANK) - return -ENODEV; + return -EINVAL; port_base = atmel_pio4_port_base(port); if (!port_base) - return -ENODEV; + return -EINVAL; mask = 1 << pin; reg = func; @@ -128,11 +128,11 @@ int atmel_pio4_set_pio_output(u32 port, u32 pin, u32 value) u32 reg, mask; if (pin >= ATMEL_PIO_NPINS_PER_BANK) - return -ENODEV; + return -EINVAL; port_base = atmel_pio4_port_base(port); if (!port_base) - return -ENODEV; + return -EINVAL; mask = 0x01 << pin; reg = ATMEL_PIO_CFGR_FUNC_GPIO | ATMEL_PIO_DIR_MASK; @@ -154,11 +154,11 @@ int atmel_pio4_get_pio_input(u32 port, u32 pin) u32 reg, mask; if (pin >= ATMEL_PIO_NPINS_PER_BANK) - return -ENODEV; + return -EINVAL; port_base = atmel_pio4_port_base(port); if (!port_base) - return -ENODEV; + return -EINVAL; mask = 0x01 << pin; reg = ATMEL_PIO_CFGR_FUNC_GPIO; |