From patchwork Mon Oct 8 15:24:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 148414 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3799952lji; Mon, 8 Oct 2018 08:39:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Piv4g3H5GcqXvcihgFRCbXh1hlnrst74KuBi2ldvjyz9qGdCN86eWma0daFwkxjWYZIf+ X-Received: by 2002:a17:902:b7cb:: with SMTP id v11-v6mr24583799plz.79.1539013158104; Mon, 08 Oct 2018 08:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013158; cv=none; d=google.com; s=arc-20160816; b=D6GDSmRqPV2poF96G6wE0kFVsOVEEghUwe+j7jEetN04xgPLj5yBSSqoeNyOTpD9cl uS71VovLWgIlOe7JUL6OQmv1d7sNqDA1tsAvlyHziADaS+7acjxzhBUN3sGMZjz0IbT5 qD9AYtUR8gW4iPL6ZPBxEFf8Elom1GxWN19gejGw8XjFHybRGhQ+pe91shLSbIKzMGDu ERXYPYqdB6Q6HbB9Q99xkJz3Zom0aW0jlxbrGvDbsmDwH2gkemDfeqjYCOURMd6ETDbu P5G8JUa7LnSCKrptrj5RLn9WNjNaMQfxPY7mFPUMDGkMm+AyGfQdezqUDFJovmvJweeW Gltw== 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 l129-v6si18691978pga.219.2018.10.08.08.39.17; Mon, 08 Oct 2018 08:39:18 -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 S1726750AbeJHWhs (ORCPT + 32 others); Mon, 8 Oct 2018 18:37:48 -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(-) -- 2.17.1 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",