Re: [RFC] Add DEV_NOT_IMPLEMENTED error code
Mitsis, Peter <Peter.Mitsis@...>
toggle quoted messageShow quoted text
From: Andre Guedes [mailto:andre.guedes(a)intel.com]
Sent: February-12-16 8:52 AM
Subject: [devel] [RFC] Add DEV_NOT_IMPLEMENTED error code
It seems we don't have a consensus about what error code the device driver
should return in case a given driver API is not implemented. If we take a look at
suspend() and resume() functions, which are not implemented by some device
drivers, we can find three different return codes:
- DEV_OK: used in i2c_dw.c, i2c_atmel_sam3.c and gpio_sch.c
- DEV_INVALID_OP: used in pwm_dw.c, gpio_mmio.c and gpio_atmel_sam3.c
- DEV_NO_SUPPORT: used in i2c_qmsi.c and spi_qmsi.c
For these situations, a new error code (DEV_NOT_IMPLEMENTED) seems to be
applicable. If a new error code is not desired, we should agree on one and use it
in all device drivers.
[Peter] - Is there a reason why should not use the existing error code ENOSYS? From the description taken from http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
(pasted below) I would think that it would fit our purposes.
Macro: int ENOSYS
Function not implemented. This indicates that the function called is not implemented at all, either in the C library itself or in the operating system. When you get this error, you can be sure that this particular function will always fail with ENOSYS unless you install a new version of the C library or the operating system.
Join email@example.com to automatically receive all group messages.