summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/nx
diff options
context:
space:
mode:
authorNishanth Aravamudan2015-07-03 00:38:48 +0200
committerHerbert Xu2015-07-06 10:32:02 +0200
commitfa9a9a084a2153095d0433188be232b0127ab23c (patch)
treef449fd48209e03d9889ee838aa8bc8364764ac13 /drivers/crypto/nx
parentcrypto: ccp - Provide support to autoload CCP driver (diff)
downloadkernel-qcow2-linux-fa9a9a084a2153095d0433188be232b0127ab23c.tar.gz
kernel-qcow2-linux-fa9a9a084a2153095d0433188be232b0127ab23c.tar.xz
kernel-qcow2-linux-fa9a9a084a2153095d0433188be232b0127ab23c.zip
crypto: nx - nx842_OF_upd_status should return ENODEV if device is not 'okay'
The current documention mentions explicitly that EINVAL should be returned if the device is not available, but nx842_OF_upd_status() always returns 0. However, nx842_probe() specifically checks for non-ENODEV returns from nx842_of_upd() (which in turn calls nx842_OF_upd_status()) and emits an extra error in that case. It seems like the proper return code of a disabled device is ENODEV. Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/nx')
-rw-r--r--drivers/crypto/nx/nx-842-pseries.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/nx/nx-842-pseries.c b/drivers/crypto/nx/nx-842-pseries.c
index 3040a6091bf2..819c23c546e3 100644
--- a/drivers/crypto/nx/nx-842-pseries.c
+++ b/drivers/crypto/nx/nx-842-pseries.c
@@ -556,7 +556,7 @@ static int nx842_OF_set_defaults(struct nx842_devdata *devdata)
*
* Returns:
* 0 - Device is available
- * -EINVAL - Device is not available
+ * -ENODEV - Device is not available
*/
static int nx842_OF_upd_status(struct nx842_devdata *devdata,
struct property *prop) {
@@ -569,6 +569,7 @@ static int nx842_OF_upd_status(struct nx842_devdata *devdata,
dev_info(devdata->dev, "%s: status '%s' is not 'okay'\n",
__func__, status);
devdata->status = UNAVAILABLE;
+ ret = -ENODEV;
}
return ret;