Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3609417ybl; Mon, 3 Feb 2020 03:26:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyEtdBH5lnkiG6ef87mRIhW+/xmVU+UFADVkTFLlq+mEdHIRG72JOQu92Ut5+EePCRU5I3q X-Received: by 2002:aca:814:: with SMTP id 20mr14486690oii.159.1580729205622; Mon, 03 Feb 2020 03:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580729205; cv=none; d=google.com; s=arc-20160816; b=ido0Ashrscxf3KO/Afz4uwS+Dlgrev7UemkyDR0RzmNqKKhvdalZVTL8hmXqDyMdZl hokXslgbjJDxHRMHpE5QI4C/PdySUmhJ1JAuVzY2L3/iI318kU5V62Ak1gMI0N08DO46 +naoLt6ZmHO/HzvdfpOJux6g/eCYPFH4DoCcSDKv2oVZ3m9I+uGKTnzcOBh1ieZU7ANX YVojx8TGatUiE2iBYPkhIv+kJ8jH0C6jGSiiRZTYDnGB0JFIZSOW5DCuO3dy819FlZSo PEfdSbAO1ASwpvKuxL8Yyz11RUBVU33QUVpHUJWDPxVFNX5xbhW5Ir7HY7uYI/5UrlOb QqfA== 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=M2jnD6diEAiCiDSSKt4lpAXDZaO42lzlkkGu8G6hrk0=; b=s4LVg139TzTLwUtNGDFlI1Qti8oxg3qT2NpDMwfRztlvueBGcPuj5IzSjD1tsB7cPi BQMAt5Jmzt7afMdQu1Z+dtCnSCCRDZB43nAaoi2EsgF5kHBDjK4RHVzCWyozhOFyANUb Vmc6ON1tGQug3FX2AJLy/4XyvP9HjfcAskcI++Uy7yMeqV1vQCAIxCED7FYOwNVN1jpz 0+bJ9ZPbsky/nkeEWiJGB5aqan3Vx4DeyKWZWMj97risCkCM58Lyy149joh0CYhgDxem GxnCeEGXE54fosC+ax+1nxZ8EuP+RRTLCiz4so1f9h9SQ8wzQ2yY6A7gaaLMbH97bQUh PXeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=d1iMBlHT; 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 z14si8674790oth.15.2020.02.03.03.26.33; Mon, 03 Feb 2020 03:26:45 -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=d1iMBlHT; 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 S1727790AbgBCKJ4 (ORCPT + 99 others); Mon, 3 Feb 2020 05:09:56 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:60663 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbgBCKJz (ORCPT ); Mon, 3 Feb 2020 05:09:55 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 013A7d68002999; Mon, 3 Feb 2020 11:09:03 +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=M2jnD6diEAiCiDSSKt4lpAXDZaO42lzlkkGu8G6hrk0=; b=d1iMBlHTZIAisSNdM50aON9r3VxqSNyPDE0F2aH87mYbz5CVQugjuG14qMgiTmNsIl4x DOBs4A8gR9Zl9SDDIRKlCzNGA9Hy5T8HjVEnAc5z95hzH5lMGmo0i5eRQXWZeIIO6jDz tTlL5FKV2t0zm0LxaLDs74s29ZXpRdjBQDob/G8X9egkAgSLvA78l1Wd/Kkhzh90oiZl VXOaDsQ8mPLUa14dEPFZw5bTttYPob3ljlQZ9POWXtBTOQNMTUry8Rwxsxt3bXribX5j ktAxADmqULuHb4VAJIYXy6mMW0O+kSpkDv/mtCl14n5YDBSLIwymc+0ZS4dDR8q/bGHL 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 2xw0010k6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Feb 2020 11:09:03 +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 CEC7B100034; Mon, 3 Feb 2020 11:09:00 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node2.st.com [10.75.127.17]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BCC142BE22D; Mon, 3 Feb 2020 11:09:00 +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:09:00 +0100 From: Olivier Moysan To: , , , , , , , , , , CC: Etienne Carriere Subject: [PATCH 3/6] ASoC: stm32: i2s: manage error when getting reset controller Date: Mon, 3 Feb 2020 11:08:11 +0100 Message-ID: <20200203100814.22944-4-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: SFHDAG7NODE1.st.com (10.75.127.19) 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 i2s 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_i2s.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index 3e7226a53e53..cdcc00d9a67e 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -866,12 +866,16 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev, } /* Reset */ - 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); return 0; } -- 2.17.1