From patchwork Sun Jan 6 08:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154843 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355826ljp; Sun, 6 Jan 2019 00:39:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JLj38oAMWPjE14JcqNcvrfvyKtC+dJXL0MPhLduz34oEpJKOz7ebvBB6B6pAWs1/oTCtW X-Received: by 2002:a65:4784:: with SMTP id e4mr6986053pgs.12.1546763958276; Sun, 06 Jan 2019 00:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763958; cv=none; d=google.com; s=arc-20160816; b=AaY+JE14wcNS8FrMFgqiqxmZpu+QqhF5VIaf9RDfdEtlyGl8mk/s2XHwvMEeOoxHeh WQ2yifshpQduvuzkH7we9ECNRhyYHFeVoJaijEYp83dO271hqd0zURljxCGglFXHdTRc UEgyYKB+EXsGEEtWBDd/qRsXu9fO4gkmo6jJeEl/IbEwEt2nGyrPhf6ilPzdljMgPXzV OGdFVdg6jLUkAGHQmJP0i69pkv883UmNha95Cn14GnvydOft/87c82bNIYr4sohPVZNB BVRjHbHLz+xkqv41y/sCPZXvBl0BowymDYE1Usd5QX8q6hqLDIMX+LRMpCAZOgFoDBoo QEmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=V3boBg1mIoonUDiKHH/hfwf8ePu+BUGNkxhLC1Rv7YM=; b=yf4GRBm2Ssh/D4pjTsc+AcOkW1P3ooxXIIGsN7jb79jlgOVztOv0yqmXmD8nw1NjaZ ijNFfvf/ml/ufFqdaOpUyT32nup6EXaDUQ9wxqOe9sehROFHKlnWMeE4V+lbYaDd+wTo 4brMNZYQeMkD/uWkWuIAptA2uWHZQiFFR0RXAhURKok3bppIGcEr1guHw6nhWBBMPmAS rG1NwaTed1Bv2RV7xIOU0TRWdkvc1dzgRu4qwY0BNwNXUUVIu0whPDs6JgnioJt14k/z 9V+3LPx7z57UFs3mhhOBqu1N+OLtq08t770Z82TZdTlmAE57b5YMWIMlQs9VmqUnl6f9 leJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si2095549pln.313.2019.01.06.00.39.18; Sun, 06 Jan 2019 00:39:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726762AbfAFIjR (ORCPT + 31 others); Sun, 6 Jan 2019 03:39:17 -0500 Received: from mx2.suse.de ([195.135.220.15]:57184 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726438AbfAFIiE (ORCPT ); Sun, 6 Jan 2019 03:38:04 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 04EB1ACAE; Sun, 6 Jan 2019 08:38:03 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , "David S. Miller" Subject: [PATCH lora-next 02/11] net: lora: sx130x: Fix error codes Date: Sun, 6 Jan 2019 09:37:45 +0100 Message-Id: <20190106083754.6004-3-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/lora/sx130x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.16.4 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);