]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: define GB_OP_NONEXISTENT
authorAlex Elder <elder@linaro.org>
Wed, 10 Dec 2014 14:43:33 +0000 (08:43 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 10 Dec 2014 15:36:29 +0000 (10:36 -0500)
The i2c protocol needs a way to indicate an i2c device doesn't exist
(which is not necessarily an error).  Define GB_OP_NONEXISTENT to
indicate this, and updating the status<->errno mapping functions
accordingly.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c
drivers/staging/greybus/operation.h

index 046ed2a99f4551abc23bc510ea1f1ea4fb236f83..742eccc4b989fe8c8c5747caa950a7940656a7a7 100644 (file)
@@ -396,6 +396,8 @@ static int gb_operation_status_map(u8 status)
                return -EINVAL;
        case GB_OP_RETRY:
                return -EAGAIN;
+       case GB_OP_NONEXISTENT:
+               return -ENODEV;
        case GB_OP_MALFUNCTION:
                return -EILSEQ;
        case GB_OP_UNKNOWN_ERROR:
@@ -431,6 +433,8 @@ static u8 gb_operation_errno_map(int errno)
                return GB_OP_RETRY;
        case -EILSEQ:
                return GB_OP_MALFUNCTION;
+       case -ENODEV:
+               return GB_OP_NONEXISTENT;
        case -EIO:
        default:
                return GB_OP_UNKNOWN_ERROR;
index a173aa9feb1745f042c2655c60c9326735c35ce0..1ade52bb1168c6daca0ffe7cf65d1c4983c2e070 100644 (file)
@@ -34,6 +34,7 @@ enum gb_operation_result {
        GB_OP_OVERFLOW          = 0x05,
        GB_OP_INVALID           = 0x06,
        GB_OP_RETRY             = 0x07,
+       GB_OP_NONEXISTENT       = 0x08,
        GB_OP_UNKNOWN_ERROR     = 0xfe,
        GB_OP_MALFUNCTION       = 0xff,
 };