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: 1021055 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43XX4J2Xm1z9s9h for ; Sun, 6 Jan 2019 19:38:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbfAFIiu (ORCPT ); Sun, 6 Jan 2019 03:38:50 -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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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(-) 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;