From patchwork Tue Sep 4 13:39:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145928 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3677893ljw; Tue, 4 Sep 2018 06:39:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ/vMjkMGJlWSh/7y17C4HJ5vWtjVzi2sjx50MFnGhSxe/L23CdnN4fENcGL8wVhnCzAKan X-Received: by 2002:a62:1e81:: with SMTP id e123-v6mr34744482pfe.24.1536068378883; Tue, 04 Sep 2018 06:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536068378; cv=none; d=google.com; s=arc-20160816; b=lbe2mEGvfAoNrireoLSeXaew1X/ht+YuUy829w1wMDM12oKlPrYyOWqaStAFWbc3cT DWceaUf3EZQIsz+36qTX0jl5AgsEb1dfdmv8z7yBd7TqCNlpeq862t+QbVzAbGddp4T5 zxSZ2hfRqL190smX+jCLnG29KuKcAdH8A2MYWRKzG0GIcYmYBr9pRxpC7FgMFG+7om68 lUQZZRzAyqawIfTB6oM8XZhNbn26roWsJvgCuZsvY5TcCAcdVQ5E6C45DeETvxlsw2UI azIbQ29H5rEFkrtZDzIWvVTWioiTLFPqorTEQcBOC4/G6fgzbTPURr1IIEiNZYjD/gSB Ln4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=uLaAWgO3vZa8Bb3AHyBCIHK3GHHA+k3AJAvEhx6lZwc=; b=XUKR5UANucUnQALTPfhI43+7dJlgYP1WQfZpekmpt/xbrN/HxZ1S96TpeT+T79N/Op rEc+Yk852PvZ1nhB2QJghAtQI+nP/tk/XhxASosfPvJlECD7wrRWn80A2W5DKzMmZGWA IR0N2+VTf/i9YA50lBmDyZgN64gfg1802HaGk0oDb9OvjuGn2Q59A4YwpE72qwEYrjjw j6k7QcXduCZ2YRprDy5NEkSeEUTCfDd0Iy5Xl8pSwOfKnyVUxOUN1ZOuGbXYTtQc1QEv IJUyYXYoAO+A4b3SkzwhFuXK2G+c1gYypj6qQqgGh65PGajm5lDxMiborpoHIwuNq6Gq H4qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cXA8h0t4; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si20350823pgc.459.2018.09.04.06.39.38; Tue, 04 Sep 2018 06:39:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cXA8h0t4; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727009AbeIDSEs (ORCPT + 1 other); Tue, 4 Sep 2018 14:04:48 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44576 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbeIDSEs (ORCPT ); Tue, 4 Sep 2018 14:04:48 -0400 Received: by mail-lj1-f193.google.com with SMTP id q127-v6so3165903ljq.11 for ; Tue, 04 Sep 2018 06:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=uLaAWgO3vZa8Bb3AHyBCIHK3GHHA+k3AJAvEhx6lZwc=; b=cXA8h0t4ZWAAzPKXCF7HLEhWoG/z23vAFZKyJScpb9Naz9Mgndu4ZgxJDgYDFst3En j41k5ZHtAXU1E9YT/S0Sih3c0+PBceNC8owzhHryMMOdpRHvLBDc6D0983Kd7q10d/lC Ms8c68kc/nTf0o04vfGVo7HSr1Qb0A1cBQqgA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uLaAWgO3vZa8Bb3AHyBCIHK3GHHA+k3AJAvEhx6lZwc=; b=kkj71H3zzQMyNO5O2TCsdC4cI2K/5uQaeyGw6dpbuxzXT5F6i1h7YEZ2KfWrscjo5s jNkVKJAc/f8O6F5jLgarMHztiTJejPTmcaWtrFJs5c/Rzdk4JX1uHBSqmAK6947OBcZ8 jln7S+w2z8QIrsazCSOwZaIWOZcCdX/c05qZIqw76gmSBr9e5KtCVSoUOhXH11u+X3w0 ndEzdOVfgZZ9NXI8Oy2p0zmbCWWXiep4piuYzg/J/0wwM+/2BdZpLtatxzsSkMypTn9j Sz4K7Z32t04tLACWOs15jqZtuhgbX8Gh1PLKNEd3M7MsorgdHaJZ4j/Dygm0EnXoDsh/ VfLw== X-Gm-Message-State: APzg51CtLtFcdWV8hTZGD9KhDJhWD+PXr7cUMsIfBo1UQDBnc+TKVEtx tqadz136M4/qpzC/Vp20ZbkE4IA5GGJ/DQ== X-Received: by 2002:a2e:429c:: with SMTP id h28-v6mr20251143ljf.67.1536068376181; Tue, 04 Sep 2018 06:39:36 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id p11-v6sm3925913ljc.50.2018.09.04.06.39.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Sep 2018 06:39:35 -0700 (PDT) From: Linus Walleij To: Mark Brown , linux-spi@vger.kernel.org Cc: linux-gpio@vger.kernel.org, Linus Walleij Subject: [PATCH v2] spi: gpio: Fix copy-and-paste error Date: Tue, 4 Sep 2018 15:39:30 +0200 Message-Id: <20180904133930.22182-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This fixes an embarrassing copy-and-paste error in the errorpath of spi_gpio_request(): we were checking the wrong struct member for error code right after retrieveing the sck GPIO. Fixes: 9b00bc7b901ff672 ("spi: spi-gpio: Rewrite to use GPIO descriptors") Reviewed-by: Geert Uytterhoeven Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Add Fixes tag - Collect Geert's ACK - Drop unrelated whitespace fix --- drivers/spi/spi-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 0626e6e3ea0c..421bfc7dda67 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -300,8 +300,8 @@ static int spi_gpio_request(struct device *dev, *mflags |= SPI_MASTER_NO_RX; spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW); - if (IS_ERR(spi_gpio->mosi)) - return PTR_ERR(spi_gpio->mosi); + if (IS_ERR(spi_gpio->sck)) + return PTR_ERR(spi_gpio->sck); for (i = 0; i < num_chipselects; i++) { spi_gpio->cs_gpios[i] = devm_gpiod_get_index(dev, "cs",