From patchwork Mon Sep 3 21:40:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 145826 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2935743ljw; Mon, 3 Sep 2018 14:40:23 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ4lHIdjLTn7nJnDiT6hZoAO4hRYH007XruZ3X68q7AmXqtBxyE0Bc7qYrdp1c6h7cA/VAc X-Received: by 2002:a17:902:18a:: with SMTP id b10-v6mr30511835plb.62.1536010823743; Mon, 03 Sep 2018 14:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536010823; cv=none; d=google.com; s=arc-20160816; b=TMAf7oo76Y/12jJP+Sr5iRdo9Q6WdBAEZTR2Zf67qKuOdrDk1jpMbvaUovI+yrLxvq 4wewQbaV/hPslvr/542lsLmsLRzpo0trzXiIhHNXLYIZk22rX20EkUw1q4huEUayhvFM 1jMthLy1EiWkJt3xfMHiepDlBVZWfKcsFFvgeArNja7xLTLxx7S6iyXlbe2YHHYLcUbt RAp2qsbQpWnPGTnX5hNfeeMfLKjICnvvTvnJI0BJXrF1SL0Bep0peHyT27Gz7wXda4pD PMvmpgscryayXSHBzLUXJ5DpWfdq+wSA4j0+dOPkajptYPx+jtVKsLkSLOLHmJGZfMqc MSOw== 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=Pf99tQa9Ha1r84gElkYiZLnPvOSHKEKR2+d44V4M/Ug=; b=s2Xut9NG1cl1GuKVrKQF1ce9e0Wkry72H70HxG53iRvGsLTjUppeV1T3a+N811wpbv O0uo37xjsQ6UqVc/j+mWIECne7qHb23Z4ts5JDUXtYXQVafu3V2NquNVHpuibsjLmE1k hSSTGOoEPISrXTLdITijf6Pl/2dZzkkq0du0GiPigYrin9N7KUVp/e17WYxOjULXVsvm dsO5MXguR3lsw86SzMoB5+l5kCVaJrcxBpfnKm/K6b3TTXSPpWwuzB/uihJyvCEGK1kb trqVdyjC2k4FO0LTzbRWEVTDVsGd+YU0rsi/IHjs3+TQGQpsEeHxpY4cu8cgzHRO1eoM 7Qqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eg5MJONv; 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 n3-v6si19887203pld.146.2018.09.03.14.40.23; Mon, 03 Sep 2018 14:40:23 -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=eg5MJONv; 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 S1726170AbeIDCC1 (ORCPT + 1 other); Mon, 3 Sep 2018 22:02:27 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35493 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbeIDCC0 (ORCPT ); Mon, 3 Sep 2018 22:02:26 -0400 Received: by mail-lf1-f68.google.com with SMTP id q13-v6so1360235lfc.2 for ; Mon, 03 Sep 2018 14:40:21 -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=Pf99tQa9Ha1r84gElkYiZLnPvOSHKEKR2+d44V4M/Ug=; b=eg5MJONv6qFPaiu/6/NotWcHbJL8mpzExV4G8M8SVQUAQoh4np5PbuRepTjq21Ie4t hA+u0otDp3Skn1e2Wei02Zb1Kt1H0Y9owVJEdZIRlUIBOZHvgjVwd8HmKjmmT6zV82Iw xYySw4XY6AIa02qRtm2xFnQoeLndG96+wii5M= 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=Pf99tQa9Ha1r84gElkYiZLnPvOSHKEKR2+d44V4M/Ug=; b=pyCNxlANAEYk8t3k5QXhSGYtvxmClWpVXVTMaZINNyO9FJ7KB3u7NWsqKIEYWur+Cf BdNmvyg7rtM+s8xB3ckXWUbbaTuySv1oIWjUuV4mWondGpH0WIVJieed2Wh9LSt7wZBD T7WihCdhkuWFWQhtBNUw30M5ZWdLOD9fro1r8/J6dLwPkxBTE/kEHkhmUHfHQ3wtBCfS SUxPN1wL7wdwr1y7RamucOU3bx6lHkOBD7OYp5R8ycHZ7VNNZfWxeAYaHLBJ4+ZQx1Kc tjZeIR3fduONPPrU1H3zPNPkGEFPGUHNu4u30zV2BCKJYaTanII/a8hf9TEk/1+eo6VO 0/JQ== X-Gm-Message-State: APzg51Cp9F0Y49T24GknBmF3Eh0ca+EkfS+Q6sbJm+MfiKItLZFHNJPA Vl1TfpHQ/TVRng2mGUvbb+cTMw== X-Received: by 2002:a19:a401:: with SMTP id q1-v6mr19605569lfc.111.1536010820997; Mon, 03 Sep 2018 14:40:20 -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 17-v6sm3653266ljs.32.2018.09.03.14.40.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 14:40:19 -0700 (PDT) From: Linus Walleij To: Mark Brown , linux-spi@vger.kernel.org Cc: linux-gpio@vger.kernel.org, Linus Walleij Subject: [PATCH] spi: gpio: Fix copy-and-paste error Date: Mon, 3 Sep 2018 23:40:15 +0200 Message-Id: <20180903214015.16147-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. Signed-off-by: Linus Walleij --- drivers/spi/spi-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 0626e6e3ea0c..9f4882f82c3c 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", @@ -422,7 +422,6 @@ static int spi_gpio_probe(struct platform_device *pdev) spi_gpio->bitbang.master = master; spi_gpio->bitbang.chipselect = spi_gpio_chipselect; spi_gpio->bitbang.set_line_direction = spi_gpio_set_direction; - if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { spi_gpio->bitbang.txrx_word[SPI_MODE_0] = spi_gpio_txrx_word_mode0; spi_gpio->bitbang.txrx_word[SPI_MODE_1] = spi_gpio_txrx_word_mode1;