Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3609257ybl; Mon, 3 Feb 2020 03:26:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwsuxWgJ9gOvmiic4Jc84IGSMX4cC8/Z9u+lFOrCnrql1CbmhQmaWE9e6SgqfxoJrqQNVnh X-Received: by 2002:aca:5ad5:: with SMTP id o204mr13877564oib.2.1580729195719; Mon, 03 Feb 2020 03:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580729195; cv=none; d=google.com; s=arc-20160816; b=V7EUzo/Z+hGYIn4m4TjPDsPcJsxC1KMyv7+p5apub+MqDpxqiC53prJtl11nImGHMo Z6nH5XzAKq0voD1heVTd/yzZSedzbt+f3q8Rzj5v/ZWm9sS77ymmVG9sQQ6yWdsb1vMZ gVgHLQicAIrXybwzCIKViJv6YnlCRx/wXvLGXVpacMssVlM/xxDbAQrYZyReERs1QnpF wdh9SJGJJdUZySlBBslnMlCdO6rytxK5uZHWBt9uYX1JElpa5AghHO4/6C0s9ymYGgsU HUicPDHb4mvu5GFXBC0VqwFniNk9fOJE73831gzhgCXFd1HtSjBHND6qIP7OuPSGwcJM iIEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Cy08n9iwXNQ8jtysqJnyDeB2lWb+64plHYMcvc8UE4I=; b=NRA9YV7PD/xdOzlpFXIYb1KttEBio8sKda+Nh+v6FTcwCLgOFKw1xEbZobSBipocMN 8s+kl1mB+43UG/40A2/WjZMSxCbYc9HTP+dVtrJ00YhlvQJvzhs9pgsYqRKcCPEuAhPu sOlw8l3jlWEz4Y763s/C3Tgxmv+yfPXzS4Yxsprkf9YcpsJSUJ9NGxz7FaS8y01mJ1Af oiBx8zZ6G9mOvHerROXuWXfQGeeMcO+hpls63RI4Uiz6b90Z30AO9FON8EQLU5iwHfej Mqs/ahQtEP9Qn1J5k3yVuEE+P0BeETfbOdq9HabHqJwF2yrDKFfRX8sJiUEAALjB52f4 G5xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=mSYK6W0X; 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=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si8897370oti.269.2020.02.03.03.26.22; Mon, 03 Feb 2020 03:26:35 -0800 (PST) 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=@st.com header.s=STMicroelectronics header.b=mSYK6W0X; 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=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727693AbgBCKJv (ORCPT + 99 others); Mon, 3 Feb 2020 05:09:51 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:46360 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727511AbgBCKJv (ORCPT ); Mon, 3 Feb 2020 05:09:51 -0500 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0139vJGZ024556; Mon, 3 Feb 2020 11:09:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=Cy08n9iwXNQ8jtysqJnyDeB2lWb+64plHYMcvc8UE4I=; b=mSYK6W0Xxm4D02Y9MbKoVkRxz50WXPcD6oP2+HmsUfATSFBcu+XYRvXWJM1hD3rnkRdS zOnZmraLDCujTB2MThL1ZHr+aijse24P9GmJrKu3bsAKnxL7WmiZxjkSe1e+9hYHMELs 2jJspha6Yzs8tw/P2PmRTAoaR52AFYStoj5eW57E6Lv0keHwSzbXEXIBHkSyICfa11Yl z0saHjaWyiC3Ui/ugFkSYejoEt6vIufZVeZRHjrM3j+3PpHxantdNziqKdjwKgACtZu2 VuSD+wQ/tJvjyVoKkRYhtnZhaDG5uk9j648LK3SnFHX9qb/1fUS+OqWx2x4gpR7yGHhd 4Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2xw13ngdpr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 11:09:04 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id EB809100039; Mon, 3 Feb 2020 11:08:59 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node2.st.com [10.75.127.17]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E01D62BE22D; Mon, 3 Feb 2020 11:08:59 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG6NODE2.st.com (10.75.127.17) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 3 Feb 2020 11:08:59 +0100 From: Olivier Moysan To: , , , , , , , , , , CC: Etienne Carriere Subject: [PATCH 2/6] ASoC: stm32: spdifrx: manage error when getting reset controller Date: Mon, 3 Feb 2020 11:08:10 +0100 Message-ID: <20200203100814.22944-3-olivier.moysan@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200203100814.22944-1-olivier.moysan@st.com> References: <20200203100814.22944-1-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG8NODE2.st.com (10.75.127.23) To SFHDAG6NODE2.st.com (10.75.127.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-03_02:2020-02-02,2020-02-03 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return an error when the SPDIFRX driver fails to get a reset controller. Also add an error trace, except on probe defer status. Signed-off-by: Etienne Carriere Signed-off-by: Olivier Moysan --- sound/soc/stm/stm32_spdifrx.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c index 3769d9ce5dbe..9f80ddf34443 100644 --- a/sound/soc/stm/stm32_spdifrx.c +++ b/sound/soc/stm/stm32_spdifrx.c @@ -978,12 +978,16 @@ static int stm32_spdifrx_probe(struct platform_device *pdev) return ret; } - rst = devm_reset_control_get_exclusive(&pdev->dev, NULL); - if (!IS_ERR(rst)) { - reset_control_assert(rst); - udelay(2); - reset_control_deassert(rst); + rst = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); + if (IS_ERR(rst)) { + if (PTR_ERR(rst) != -EPROBE_DEFER) + dev_err(&pdev->dev, "Reset controller error %ld\n", + PTR_ERR(rst)); + return PTR_ERR(rst); } + reset_control_assert(rst); + udelay(2); + reset_control_deassert(rst); ret = devm_snd_soc_register_component(&pdev->dev, &stm32_spdifrx_component, -- 2.17.1