From patchwork Sun Jan 6 08:37:50 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: 154841 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355605ljp; Sun, 6 Jan 2019 00:38:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Cja3iEe0jRNX0If2OtGhZF/E9o1ZZ9xsK64hXr7iIpxe65Z4uFh4ePQSyPF4g9Gkc4Mze X-Received: by 2002:a63:ee0e:: with SMTP id e14mr6950288pgi.8.1546763934513; Sun, 06 Jan 2019 00:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763934; cv=none; d=google.com; s=arc-20160816; b=VgYYCPqFrqwwfZTEHrTt7WmsFdisdNris3Yi2XQq7jKyuajIvI6F+h2vE4++pyNNls uMEZkpjd8yf3cxslNEAw9fo67+2IgDfWeyV++V/gxMnvio0ADZXntatie0Nua2rf8dCZ QwL7M+bS6wOcNXKw1pVTICBd8riTIrUCI51nfHWX1R7zQ3Qq34Ughywc1ARxVL6BrZec KrwuISwnlLpR1I7ztZe4cnKGx/H0G6/gG5sSqQFNr9kbFTrJFFHclY9MiMrTHherH+R8 GrjF3MgDNALe0Mbg571McT9IfJG1MLoPpviNS/mJwXvvxnNHkWVd+/z9MfE8eSFec4ou LaBw== 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=Qsh2+O8yR38DfJUeWS7s6xOiJeGLQrnh719ELrMve2I=; b=h8VA6EPVppwsmgnTRs/fmDJblS95XvMqh/Ynxz7NcD5to9RICXkzYTghbznUPWrCB8 +2lAcqtdmRB0aEhFZjMfmsS0JIliFw8B73f9f42fuJsjVFO0EePJv4oGxcJbyKvTmlOy 5/7BhHZ4LU2dlW7MbILVlyLBBRDYj/xvJI7TjWewwGk6BKOCHIkZ1SnAZpkx1YFH3h87 p64I8kLs6HCVDgLzmcn4yegUsh5JHt5htD3K9ksqAO2NEpSWer4CxUSWxmAKzaQtsCx4 OEcaH7tXaJj7YegcI6R4qvBLuibi3QESoBrwerWd8cs4jZM6Cjtk3KndQ7QRJSSc8tY4 4h1w== 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 u188si19648615pfb.232.2019.01.06.00.38.54; Sun, 06 Jan 2019 00:38:54 -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 S1726449AbfAFIiw (ORCPT + 31 others); Sun, 6 Jan 2019 03:38:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:57236 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726477AbfAFIiG (ORCPT ); Sun, 6 Jan 2019 03:38:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CA9FAADF2; Sun, 6 Jan 2019 08:38:04 +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?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 07/11] net: lora: sx130x: Force regmap field writes before function boundaries Date: Sun, 6 Jan 2019 09:37:50 +0100 Message-Id: <20190106083754.6004-8-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 As a cautionary step, force writing out registers before calling helpers or returning. Cc: Ben Whitten 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 bc2d4b1165d8..a0759e277574 100644 --- a/drivers/net/lora/sx130x.c +++ b/drivers/net/lora/sx130x.c @@ -315,7 +315,7 @@ static int sx130x_load_firmware(struct sx130x_priv *priv, int mcu, const struct kfree(buf); - ret = sx130x_field_write(priv, select_mux, 1); + ret = sx130x_field_force_write(priv, select_mux, 1); if (ret) { dev_err(priv->dev, "MCU RAM release mux failed\n"); return ret; @@ -359,7 +359,7 @@ static int sx130x_agc_calibrate(struct sx130x_priv *priv) return ret; } - ret = sx130x_field_write(priv, F_MCU_RST_1, 0); + ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0); if (ret) { dev_err(priv->dev, "MCU 1 reset failed\n"); return ret; @@ -459,7 +459,7 @@ static int sx130x_load_all_firmware(struct sx130x_priv *priv) return ret; } - ret = sx130x_field_write(priv, F_MCU_RST_1, 0); + ret = sx130x_field_force_write(priv, F_MCU_RST_1, 0); if (ret) { dev_err(priv->dev, "MCU 1 release failed\n"); return ret; @@ -542,7 +542,7 @@ static int sx130x_loradev_open(struct net_device *netdev) goto err_reg; } - ret = sx130x_field_write(priv, F_CLK32M_EN, 1); + ret = sx130x_field_force_write(priv, F_CLK32M_EN, 1); if (ret) { dev_err(priv->dev, "enable 32M clock failed (%d)\n", ret); goto err_reg; @@ -708,7 +708,7 @@ int sx130x_probe(struct device *dev) msleep(5); - ret = sx130x_field_write(priv, F_RADIO_RST, 0); + ret = sx130x_field_force_write(priv, F_RADIO_RST, 0); if (ret) { dev_err(dev, "radio deassert reset failed (%d)\n", ret); return ret;