Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3863088pxj; Mon, 24 May 2021 17:10:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwprfGIHCVzHFp2GHlKbfLWWHsn8qgVhY943UoROTsVK6t0/orcJsE13AHqgv8uFlogDnNy X-Received: by 2002:a17:906:7f0d:: with SMTP id d13mr26138862ejr.60.1621901453124; Mon, 24 May 2021 17:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621901453; cv=none; d=google.com; s=arc-20160816; b=jVk1XzzYkNgAp2GPoBY/iL7KEHM//ybmSW6CqSeLFfbxnvEhoocr+tWtPWe6T6BN6m Xbyp63hjWxlH13rUXnGOx2JaDY38F8kq4Yzme/HYlECw7aAkYQ6uB0vQNc0ouDN4xgxy DUI0pt4mTkyDZXpVB69BbafNhdv4GsTR43aBO92yjACytVqb2hPw07xfq1B+wkE6mp5X G3+tr/3rGAsv6x4NCHhienxaywRnsRRT9iPcBDaszGymXC+KrgXeGehlR4edARNLq/3f zR8yjwFFQBsdUOieOuGQTa1+aX91HXl/Vvws0KxZDTNqAt3ndBpYuglgacGzMyUdR1CJ n0oA== 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:date:cc:to:from:subject :message-id; bh=MCQq2nNvJwvmh1CbKXWIDNNKXbQZwHZa3w6A4QFqjuo=; b=F2QUp2zEWaxgY2VXLSc6XacjxkvVogDyo6j4d88ESeCp0jjx1GTcyYUsn2jDxzUY/r tSUzrCYAF8H8idbxk52gc2L9MbVJQ5nlA6tMjqvqcERvAnC4KlzkFcF3OX4y6yRzteel 0gk1+Rt3KjrrT7PPYVOEiTMuvjJxOO4P7t8jo421gO0+Ol5ypwO95i5C5jm1nQWkNW+j m+/d46zfqClVFyO9iDLMdMxJB/dblCpzkizHEaTv/nQlqVAG/H4zHwPcXwcRj/tFUwG+ Mm/QibyODJGxv+TjgTPcHsLowVnH9wKyTEJx4KyIZN3VV7Ja2bTcqaqeR6Qg2gJQdzDL FVYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h35si14608936edd.312.2021.05.24.17.10.30; Mon, 24 May 2021 17:10:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229581AbhEYAIx (ORCPT + 99 others); Mon, 24 May 2021 20:08:53 -0400 Received: from smtprelay0035.hostedemail.com ([216.40.44.35]:33538 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229540AbhEYAIw (ORCPT ); Mon, 24 May 2021 20:08:52 -0400 Received: from omf04.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 5A1E9100E7B44; Tue, 25 May 2021 00:07:19 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA id 62630D1514; Tue, 25 May 2021 00:07:18 +0000 (UTC) Message-ID: <9f21272719a3983bda647147e8460615159875b1.camel@perches.com> Subject: Re: [PATCH] ASoC: meson: use dev_err_probe From: Joe Perches To: Jerome Brunet , Mark Brown Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Date: Mon, 24 May 2021 17:07:17 -0700 In-Reply-To: <20210524165136.400702-1-jbrunet@baylibre.com> References: <20210524165136.400702-1-jbrunet@baylibre.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.90 X-Stat-Signature: k7h5guxk81qrouyfdntbrc3x63gk54mj X-Rspamd-Server: rspamout02 X-Rspamd-Queue-Id: 62630D1514 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19pOUzXC5Hogvmi/j0xkmzd9aHSBMxFLPU= X-HE-Tag: 1621901238-781495 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-05-24 at 18:51 +0200, Jerome Brunet wrote: > Use dev_err_probe() helper function to handle probe deferral. > It removes the open coded test for -EPROBE_DEFER but more importantly, it > sets the deferral reason in debugfs which is great for debugging. trivia: It seems that the use of %ld, PTR_ERR() isn't particularly useful now as dev_err_probe already uses %pe to emit descriptive error messages. > diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c [] > @@ -352,17 +352,16 @@ int axg_fifo_probe(struct platform_device *pdev) > ? > > ? fifo->pclk = devm_clk_get(dev, NULL); > ? if (IS_ERR(fifo->pclk)) { > - if (PTR_ERR(fifo->pclk) != -EPROBE_DEFER) > - dev_err(dev, "failed to get pclk: %ld\n", > - PTR_ERR(fifo->pclk)); > + dev_err_probe(dev, PTR_ERR(fifo->pclk), > + "failed to get pclk: %ld\n", PTR_ERR(fifo->pclk)); here. > ? return PTR_ERR(fifo->pclk); > ? } > ? > > ? fifo->arb = devm_reset_control_get_exclusive(dev, NULL); > ? if (IS_ERR(fifo->arb)) { > - if (PTR_ERR(fifo->arb) != -EPROBE_DEFER) > - dev_err(dev, "failed to get arb reset: %ld\n", > - PTR_ERR(fifo->arb)); > + dev_err_probe(dev, PTR_ERR(fifo->arb), > + "failed to get arb reset: %ld\n", > + PTR_ERR(fifo->arb)); etc...