Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1159350ybl; Fri, 16 Aug 2019 09:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjt5e2zHQ6KeUM5Xe2DdXjmi70W13I4pxofAoLhImowOKBB7GmE7rAq3dvE8Qca6b02pjS X-Received: by 2002:a17:902:1aa:: with SMTP id b39mr10425004plb.333.1565974270167; Fri, 16 Aug 2019 09:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565974270; cv=none; d=google.com; s=arc-20160816; b=daeDzv9HW5IyJJy9d16nBSTlw8jZz+/mD8ReaxBJ844cemA1qqvNV8ZlQ74e8ZOwNL ARPZjx6DGg64jFtcW5CiApr7ktf2m31hqb8VSHyUC7qWTcDQqQVmMxiw5iJziNiYnmR4 9/QmrME7XiELVsDmk/PCOSIugGPT9HmTQBzp5ROc6CaA5FQrtr0vGKQfrA+SRCB0cJ4n eYVVG2Gq+gFN0XxDU5Eq3gW4Guvtr8xLJYxmzsyfIQHNb1jax2qb36Jp92Fe+Pzwt0aJ 2r9UAN6HNfDGwNLdz0G5Yw5/DGt6/Mp1qgGHi7tcgGcGzS4giL/H300m4DJse5/cXV7H BZ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TMl0t22j8qYVABIvPAxoYrZBeDSEu0ad3kM77/ptRoY=; b=NMKkRYw+bGysr9zhbG1GX0uum+OolsGFLq2p07jT4RVSm9B1G+kiJTWv/5kCcyAi+x cthTUTWwCgiN4HmIhGm1HYq/0CgLqrwsOAtNemGzXErkTb62DUptT0F3Hd4X5VmcXiRR H0uRFaPYsRv5hC88z/w7BP9iQ1FcZveKcMXgeTKmMyhRdsVSLhxq8L1DkV52UoT10zVd WbCdmb1moApGvJ2vc5YT5e9b81GnNqczQvmnG6AUCcr9mPBQQalcI6WJWcgjXRzA4h9i Nezik4cZvY7kYBuJJ5MnQ2bF7Ua2cwnYX5UBXYtLnTsoH8/bMWKFzOvAb/PEiRUSxVET f8GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=hbTpfDeL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si3280707pjv.56.2019.08.16.09.50.54; Fri, 16 Aug 2019 09:51:10 -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=fail header.i=@kemnade.info header.s=20180802 header.b=hbTpfDeL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbfHPQuT (ORCPT + 99 others); Fri, 16 Aug 2019 12:50:19 -0400 Received: from mail.andi.de1.cc ([85.214.55.253]:46896 "EHLO mail.andi.de1.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfHPQuT (ORCPT ); Fri, 16 Aug 2019 12:50:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TMl0t22j8qYVABIvPAxoYrZBeDSEu0ad3kM77/ptRoY=; b=hbTpfDeLYXAn+UuBGXwhvLgYW1 qE1JEkDq17OwOZsSvyKJAhAgykxc7KsKQyjq5YBrNJmbPfFZBodVEeJicEvKKDv+yL3e4rtI5E9Vg wBijc8pOhYzsAWdCHz2KN/PLm0H8cAB8oSNnxPmRQsPOOkvYg7VBe74IBRMBs2LK4JCA=; Received: from pd9e2f4fd.dip0.t-ipconnect.de ([217.226.244.253] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyfQc-0002DT-Pg; Fri, 16 Aug 2019 18:50:15 +0200 Received: from andi by aktux with local (Exim 4.92) (envelope-from ) id 1hyfQc-0008QU-CO; Fri, 16 Aug 2019 18:50:14 +0200 From: Andreas Kemnade To: linus.walleij@linaro.org, bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, linux-spi@vger.kernel.org Cc: Andreas Kemnade , "H . Nikolaus Schaller" Subject: [PATCH] gpio: of: fix Freescale SPI CS quirk handling Date: Fri, 16 Aug 2019 18:50:00 +0200 Message-Id: <20190816165000.32334-1-andreas@kemnade.info> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.0 (-) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the gta04 we see: spi_gpio: probe of spi_lcd failed with error -2 The quirk introduced in commit e3023bf80639 ("gpio: of: Handle the Freescale SPI CS") can also be triggered by a temporary -EPROBE_DEFER and so "convert" it to a hard -ENOENT. Disable that conversion by checking for -EPROBE_DEFER. Fixes: e3023bf80639 ("gpio: of: Handle the Freescale SPI CS") Suggested-by: H. Nikolaus Schaller Signed-off-by: Andreas Kemnade --- drivers/gpio/gpiolib-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 567fb98c0892..9762dd6d99fa 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -363,7 +363,7 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, /* Special handling for SPI GPIOs if used */ if (IS_ERR(desc)) desc = of_find_spi_gpio(dev, con_id, &of_flags); - if (IS_ERR(desc)) { + if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) { /* This quirk looks up flags and all */ desc = of_find_spi_cs_gpio(dev, con_id, idx, flags); if (!IS_ERR(desc)) -- 2.20.1