From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FC40C433FE for ; Tue, 26 Apr 2022 10:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347098AbiDZKgS (ORCPT ); Tue, 26 Apr 2022 06:36:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349175AbiDZKgH (ORCPT ); Tue, 26 Apr 2022 06:36:07 -0400 Received: from mxout02.lancloud.ru (mxout02.lancloud.ru [45.84.86.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADEE613CF2; Tue, 26 Apr 2022 03:17:21 -0700 (PDT) Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout02.lancloud.ru 8F9C620C0892 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH v2 2/3] ASoC: sh: rz-ssi: Propagate error codes returned from platform_get_irq_byname() To: "Lad, Prabhakar" CC: Lad Prabhakar , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel , Geert Uytterhoeven , Nobuhiro Iwamatsu , Pavel Machek , LKML , Linux-Renesas , Biju Das References: <20220426074922.13319-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20220426074922.13319-3-prabhakar.mahadev-lad.rj@bp.renesas.com> <5bb82736-50bc-eafd-7d68-df1ed966d572@omp.ru> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Tue, 26 Apr 2022 13:17:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/26/22 12:55 PM, Lad, Prabhakar wrote: [...] >>> Propagate error codes returned from platform_get_irq_byname() instead of >>> returning -ENODEV. platform_get_irq_byname() may return -EPROBE_DEFER, to >>> handle such cases propagate the error codes. >>> >>> While at it drop the dev_err_probe() messages as platform_get_irq_byname() >>> already does this for us in case of error. >>> >>> Signed-off-by: Lad Prabhakar >>> --- >>> v1->v2 >>> * No change >>> --- >>> sound/soc/sh/rz-ssi.c | 9 +++------ >>> 1 file changed, 3 insertions(+), 6 deletions(-) >>> >>> diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c >>> index cec458b8c507..d9a684e71ec3 100644 >>> --- a/sound/soc/sh/rz-ssi.c >>> +++ b/sound/soc/sh/rz-ssi.c >>> @@ -977,8 +977,7 @@ static int rz_ssi_probe(struct platform_device *pdev) >>> /* Error Interrupt */ >>> ssi->irq_int = platform_get_irq_byname(pdev, "int_req"); >>> if (ssi->irq_int < 0) >>> - return dev_err_probe(&pdev->dev, -ENODEV, >>> - "Unable to get SSI int_req IRQ\n"); >>> + return ssi->irq_int; >> >> Why not: >> >> return dev_err_probe(&pdev->dev, ssi->irq_int, >> "Unable to get SSI int_req IRQ\n"); >> > That is because platform_get_irq_byname() already does this for us [0] > (also mentioned in the commit message). In case I keep the > dev_err_probe() I'll get two prints for each error. > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/platform.c?h=v5.18-rc4#n471 Ah! Sorry, didn't read your commit log... :-/ More shame on me as it was me who added dev_err_probe() call there! :-) > Cheers, > Prabhakar [...] MBR, Sergey