Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3733503imm; Mon, 8 Oct 2018 08:40:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV61+RlRY/dX84nrjLwnVf6MD/U1povfYgUET/MK2j6FFEQWAP0Fk9krGhqjS0LqZ5g2EIFVf X-Received: by 2002:a17:902:a9c9:: with SMTP id b9-v6mr24196250plr.225.1539013247449; Mon, 08 Oct 2018 08:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013247; cv=none; d=google.com; s=arc-20160816; b=02XzWhNT8bCR4SOhmDRiR1xOUO5x1zR4ef0bAUsGDVc5Eb5kD2EZXESahvaWBJpVyd buLbH9ZYjFdJ0ZVIanaFXkL5b3CqIMeajKb76bEYi70iK6Wdt8fb17rLAC7mlM8/kAjg v9NKkXzKr3ExJJMcp128jF2DXEjW8m7sqIDhEZ/hulDhyUOV2wk6JJ5bFLuqFbOVzr0t X9gUnE9H19YvGd7B6ISdAKDrRXUtMkmApmSYuhEvIgP3MRrvKMv2D3y4VKggEsQ5sVVh /tyJc5p8X9g6GE4pOuWR7D2HgOgPVUbml9GCac/3NGROV+rJsSWQVzrrJRmmlL5ZbBsK rGrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=20gX07AAT/vgdaJo+gZtRG9wbajE+ugcZ75C2tVE4eU=; b=CjSnVkCzj0/S3lYcI0wDVLZv75k0su+rTCfBSUX/bId+V4hIEm2hPFICZtqZkmyTaI NsrnQamCD53Z6J+Tu6XJ9vfdgCpDNWckwxA9UcGOvOcAEd7fcSfFDKFY+WERYv3DaxlS EldXpS2RcuvSpFn+HaRwO9TgFXWRdc4c0FcCftxzk3tmOMcWC+m4Sb9db+y0LVx1iPVm n/ammmhLGo/1Zt2TJplipJqAkKPAEyXAzByJmMe1y0z7ULQlTLL5yWflx7NDb5sQEWrJ Q0CsOvOaomlaiyHjIohrKkcj8mMD+wzcwdgWl8GrtPQjPwAcHWaS+raq2pwf46DRi0PT 2bfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MyV8hPjQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d33-v6si18210535pla.292.2018.10.08.08.40.32; Mon, 08 Oct 2018 08:40:47 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=MyV8hPjQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbeJHWhr (ORCPT + 99 others); Mon, 8 Oct 2018 18:37:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeJHWhr (ORCPT ); Mon, 8 Oct 2018 18:37:47 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 454DC2087C; Mon, 8 Oct 2018 15:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012332; bh=6VgWlnGGEW3FaZTIn6CRcVUXyH23EcSORV6XsXNKxzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MyV8hPjQ0Djqpapj4q3iOfNcTZqyViNuf3guHVAabVOAAhSkxymk3ueApNbiSFg7A mprQzAxns97G/sL3Ok0sp7+mJL4UjyDucqg5VzHGDpae1mg/uEq/SW2QKYg6Xx9L7V Bhtkrrgbljl8GPiDEkuk9n69nYOKA2OdEMEMx3xs= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.18 05/58] spi: gpio: Fix copy-and-paste error Date: Mon, 8 Oct 2018 11:24:30 -0400 Message-Id: <20181008152523.70705-5-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 1723c3155f117ee6e00f28fadf6e9eda4fc85806 ] 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 Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 6ae92d4dca19..3b518ead504e 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -287,8 +287,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", -- 2.17.1