Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E155C43334 for ; Mon, 13 Jun 2022 14:05:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B766217F5; Mon, 13 Jun 2022 16:04:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B766217F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655129113; bh=uPQEvAOKYrbsHg74xc5wQk3cogZayeWuWDlF5H7r10w=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O7BAKkLESWXDtmipZ9hYI7rJaAWfuWqczn1qaRklFL6bCh3of0/602nvgx/Bbg23u T+O5EPxn7lj1ExwgA6ulXzNbtJvNKTIErxj9jLwanhnhey+q+7+joBBe4isPBCSwsi /dMONACBGaEhnCfsux1Vlo6oJQ1tZZuAjiv1ieSw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C8A46F804D6; Mon, 13 Jun 2022 16:03:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 90BF5F804C1; Mon, 13 Jun 2022 16:03:46 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 92A8CF800D8 for ; Mon, 13 Jun 2022 16:03:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 92A8CF800D8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RLIjLgXF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655129023; x=1686665023; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=uPQEvAOKYrbsHg74xc5wQk3cogZayeWuWDlF5H7r10w=; b=RLIjLgXFVaaEerY5DA70ckgSj2XSN7CO+FBzz25JEJZtEMoaj1Av5UAY ekB45tqxfURa/3D+/8mZqEUpuhUTRdCH/Bg4iEr5Pwpo7jJAJM30U69Tp 3Yyq0XLK3yChUpTTDgHEpo2z3bA64BTGQB6od4KnIYWpsmS0WF2NzTDZZ s8NQuN8b5dYjMESQoudvaSc+HKmBeHpxJ6B+PvkgB/YWMdOgWmcpm+CQW xKxTOsf+xlbf3PprLHhxwpYezsRgKTndehLekCXobULOMBtN1UKXiYB4l QXm8X81T3/SZaEtUcL7swAKiPMoE1AbHg19NqdSttluRixZlGRW8WuoNq w==; X-IronPort-AV: E=McAfee;i="6400,9594,10376"; a="279011477" X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="279011477" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 07:03:33 -0700 X-IronPort-AV: E=Sophos;i="5.91,297,1647327600"; d="scan'208";a="910399852" Received: from tchuynh1-mobl1.amr.corp.intel.com (HELO [10.212.112.176]) ([10.212.112.176]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 07:03:32 -0700 Message-ID: <7ef2ccca-7c9f-367b-8fd9-2fb38c816bd3@linux.intel.com> Date: Mon, 13 Jun 2022 08:10:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.9.1 Subject: Re: [PATCH] ASoC: Intel: bytcr_wm5102: Fix GPIO related probe-ordering problem Content-Language: en-US To: Hans de Goede , Cezary Rojewski , Liam Girdwood , Jie Yang , Mark Brown References: <20220612155652.107310-1-hdegoede@redhat.com> From: Pierre-Louis Bossart In-Reply-To: <20220612155652.107310-1-hdegoede@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 6/12/22 10:56, Hans de Goede wrote: > 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 > --- > 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 00384c6fbcaa..330c0ace1638 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;