Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4449649imw; Tue, 19 Jul 2022 06:52:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uClpSCtToStCTnCXupBbgv688l+joOI4M7EbgAi5aqSepwWmXQCxBFg8d8/zD11FVVLvil X-Received: by 2002:a17:907:2c78:b0:72b:64f5:11ea with SMTP id ib24-20020a1709072c7800b0072b64f511eamr31483555ejc.68.1658238768932; Tue, 19 Jul 2022 06:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238768; cv=none; d=google.com; s=arc-20160816; b=PvTOHdH6+GzwTPZPWZdsOadF8JqjAkpVNB6sG02Z4jsIGX8y8q0kA3Oc6v1Y9tVxHk nuYdTtwJdVYdRwCVGJpFboy04DNSB3+HxuEH8hefEAOluZL9MvnG0RIhatjalzePy5Xy 4fXnlfQ0vdSsqEm3aOYncbAyAHmVTYYJvyCLnwvFkeW2S98+jWco2+76mZF50WwXvTQL YxUfK4CAj2x/d2wngWayM7KRE5BsOQpcdvwUkQSaiIA6sp2+RgGYpo3Am22SVFM0Xu1b TZvUxblhDHqnbRLvLXuD2/BfHdvjr4L8L3oPIeG4TD1qtuAz9xQp1hwqqmtzMsfh/L30 pGbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3wHBYNVfcHtYSC2i2Eu/b3BvrXMBskpJset2PsAzjxA=; b=VZD/USgJYsEskUFe2ZshsPYeaa3yB5DdVjpduVLHbwu/7WstUv8C2D8ciCorTwDCzt UQSA6NrytiKqmJeNuhuAkiuDjFz1u1wIkKk/uSwARayECjfv+ItR6PA4zbwMbjRnCOIv 9LTlDUNG+DIjF7aOzkNUETOIIc7/5LhVPKIz7rWu3mI+WJmPch8aLgqLP4ySKqeuvbGZ V9sOHS/Tnm5u0gftJamBHJI5n53+Avwk2iUp8RzVBUj6KnNpqYW37apzsQLx+n1iZC+H VN5NvXFkAeoqwqQMTh9GH198+oMQyRh1BANYz3iXhfLQNXPdHrJKu+OOZbCUAB7S+tVx xhkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y+xkz8iV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc15-20020a170907168f00b0072b592be479si22999160ejc.667.2022.07.19.06.52.24; Tue, 19 Jul 2022 06:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y+xkz8iV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241566AbiGSMpr (ORCPT + 99 others); Tue, 19 Jul 2022 08:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241698AbiGSMoY (ORCPT ); Tue, 19 Jul 2022 08:44:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E5F486884; Tue, 19 Jul 2022 05:17:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 68289B81B95; Tue, 19 Jul 2022 12:17:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0888C341CA; Tue, 19 Jul 2022 12:17:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233028; bh=/sX5PM90a21Ru7lX9KW7DDa/MPScR0rwjAmahjAtP5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y+xkz8iVgJuw7H4eEhd7jwvyBEiB00m93eXN4w1J9UgipLTgp7ZtRrlXRsoRUS5lZ ysUOG1yAK026E+LtgEzsP/WoijujzhqqaE1GMMnb/tuwOfLr9IgXq+Nz/gdAYVGlk8 3CWIIz9C78Nq/Y4lACdM7/qQkBfhOjwTEfDGdeds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.15 141/167] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem Date: Tue, 19 Jul 2022 13:54:33 +0200 Message-Id: <20220719114710.122445444@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 4e07479eab8a044cc9542414ccb4aeb8eb033bde ] The "wlf,spkvdd-ena" GPIO needed by the bytcr_wm5102 driver is made available through a gpio-lookup table. This gpio-lookup table is registered by drivers/mfd/arizona-spi.c, which may get probed after the bytcr_wm5102 driver. If the gpio-lookup table has not registered yet then the gpiod_get() will return -ENOENT. Treat -ENOENT as -EPROBE_DEFER to still keep things working in this case. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220612155652.107310-1-hdegoede@redhat.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/bytcr_wm5102.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c index 580d5fddae5a..bb669d58eb8b 100644 --- a/sound/soc/intel/boards/bytcr_wm5102.c +++ b/sound/soc/intel/boards/bytcr_wm5102.c @@ -421,8 +421,17 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev) priv->spkvdd_en_gpio = gpiod_get(codec_dev, "wlf,spkvdd-ena", GPIOD_OUT_LOW); put_device(codec_dev); - if (IS_ERR(priv->spkvdd_en_gpio)) - return dev_err_probe(dev, PTR_ERR(priv->spkvdd_en_gpio), "getting spkvdd-GPIO\n"); + if (IS_ERR(priv->spkvdd_en_gpio)) { + ret = PTR_ERR(priv->spkvdd_en_gpio); + /* + * The spkvdd gpio-lookup is registered by: drivers/mfd/arizona-spi.c, + * so -ENOENT means that arizona-spi hasn't probed yet. + */ + if (ret == -ENOENT) + ret = -EPROBE_DEFER; + + return dev_err_probe(dev, ret, "getting spkvdd-GPIO\n"); + } /* override platform name, if required */ byt_wm5102_card.dev = dev; -- 2.35.1