lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190106083754.6004-3-afaerber@suse.de>
Date:   Sun,  6 Jan 2019 09:37:45 +0100
From:   Andreas Färber <afaerber@...e.de>
To:     linux-lpwan@...ts.infradead.org
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andreas Färber <afaerber@...e.de>,
        "David S. Miller" <davem@...emloft.net>
Subject: [PATCH lora-next 02/11] net: lora: sx130x: Fix error codes

Use of -ENXIO results in a misleading error message from ip command:

  RTNETLINK answers: No such device or address

Switch to -EIO for more accurate description:

  RTNETLINK answers: Input/output error

Signed-off-by: Andreas Färber <afaerber@...e.de>
---
 drivers/net/lora/sx130x.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c
index 88d4ce1aabcf..21db0ddb101f 100644
--- a/drivers/net/lora/sx130x.c
+++ b/drivers/net/lora/sx130x.c
@@ -353,7 +353,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv)
 	if (val != SX1301_MCU_AGC_CAL_FW_VERSION) {
 		dev_err(priv->dev, "unexpected firmware version, expecting %u\n",
 				SX1301_MCU_AGC_CAL_FW_VERSION);
-		return -ENXIO;
+		return -EIO;
 	}
 
 	ret = sx130x_field_write(priv, F_EMERGENCY_FORCE_HOST_CTRL, 0);
@@ -380,7 +380,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv)
 	dev_info(priv->dev, "AGC status: %02x\n", (unsigned)val);
 	if ((val & (BIT(7) | BIT(0))) != (BIT(7) | BIT(0))) {
 		dev_err(priv->dev, "AGC calibration failed\n");
-		return -ENXIO;
+		return -EIO;
 	}
 
 	return 0;
@@ -453,7 +453,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv)
 	if (val != SX1301_MCU_AGC_FW_VERSION) {
 		dev_err(priv->dev, "unexpected firmware version, expecting %u\n",
 				SX1301_MCU_AGC_FW_VERSION);
-		return -ENXIO;
+		return -EIO;
 	}
 
 	ret = sx130x_arb_ram_read(priv, 0x20, &val);
@@ -467,7 +467,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv)
 	if (val != SX1301_MCU_ARB_FW_VERSION) {
 		dev_err(priv->dev, "unexpected firmware version, expecting %u\n",
 				SX1301_MCU_ARB_FW_VERSION);
-		return -ENXIO;
+		return -EIO;
 	}
 
 	return 0;
@@ -636,7 +636,7 @@ int sx130x_probe(struct device *dev)
 
 	if (ver != SX1301_CHIP_VERSION) {
 		dev_err(dev, "unexpected version: %u\n", ver);
-		return -ENXIO;
+		return -EIO;
 	}
 
 	ret = regmap_write(priv->regmap, SX1301_PAGE, 0);
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ