greybus: svc: use EREMOTEIO for remote errors
authorJohan Hovold <johan@hovoldconsulting.com>
Thu, 19 May 2016 14:20:16 +0000 (16:20 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 20 May 2016 23:36:43 +0000 (16:36 -0700)
Return -EREMOTEIO consistently for unspecified remote errors (e.g. a
failed DME attribute read due to a remote UniPro error).

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/svc.c

index 3e22ed8..78cc0e3 100644 (file)
@@ -166,7 +166,7 @@ static int gb_svc_pwrmon_sample_get(struct gb_svc *svc, u8 rail_id,
                case GB_SVC_PWRMON_GET_SAMPLE_NOSUPP:
                        return -ENOMSG;
                default:
-                       return -EIO;
+                       return -EREMOTEIO;
                }
        }
 
@@ -204,7 +204,7 @@ int gb_svc_pwrmon_intf_sample_get(struct gb_svc *svc, u8 intf_id,
                case GB_SVC_PWRMON_GET_SAMPLE_NOSUPP:
                        return -ENOMSG;
                default:
-                       return -EIO;
+                       return -EREMOTEIO;
                }
        }
 
@@ -376,7 +376,7 @@ int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
        if (result) {
                dev_err(&svc->dev, "UniPro error while getting DME attribute (%u 0x%04x %u): %u\n",
                                intf_id, attr, selector, result);
-               return -EIO;
+               return -EREMOTEIO;
        }
 
        if (value)
@@ -412,7 +412,7 @@ int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
        if (result) {
                dev_err(&svc->dev, "UniPro error while setting DME attribute (%u 0x%04x %u %u): %u\n",
                                intf_id, attr, selector, value, result);
-               return -EIO;
+               return -EREMOTEIO;
        }
 
        return 0;