From patchwork Tue Aug 30 17:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 601083 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 776BBECAAD1 for ; Tue, 30 Aug 2022 17:53:16 +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 0DC051686; Tue, 30 Aug 2022 19:52:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0DC051686 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661881994; bh=vK46HLkJ2is2fXs67Kj7m8cZ1cDEjE0HroV1OpzpJgs=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=n0gM8HstUhyPJ3EKIpn091FIpuMYQWnrgrsBD3LxXSXGJGVdreYx47g4acNPSrDy9 Ac6cEejcuJIswwAONY9BVkVmH0HYDvu5tSwULCvhCYFX71Exw/OlSJzteR6vq7wW2p DKKXTh1YIBIMIWXnNWP7zmMv+XlTIyNWz98v++Qo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 89D26F8032B; Tue, 30 Aug 2022 19:52:23 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B668AF804B4; Tue, 30 Aug 2022 19:52:21 +0200 (CEST) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7360EF800AA for ; Tue, 30 Aug 2022 19:52:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7360EF800AA Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Oi+RM+tz" Received: by mail-lj1-x22d.google.com with SMTP id p18so8853401ljc.9 for ; Tue, 30 Aug 2022 10:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=VTjkGMpau5/qRAdXn0AI5h8erS6BqzJeV7Kg59cVfQA=; b=Oi+RM+tzjrXAvwWJ/1F2E+IM9ParyeuSLNnrQVs15TSAVeSuAE0Infw2CS1/QiRQS/ LlAQT6OHgfQwX2CiMKnx8lxZWKGZdYZtf3T1/+Wd6XEyxWKdC9/VoZx1W2IH3dnCyRxD vQonf5rzfi99B9n08RlW2+poiVwtJHH2/2gifP7L9jg1a8ZF7bS7mXRQYgDt1NnvYfEd SPAh1G+E2H6fiF2PX9PkBJYaQbdvyveYL7JizYQL0yGeSgbJh4AaTSK3KKOXPLrFkADV 0HleTJnmPIEmZYXw6u5uWrWSGv2vJSrgFw+A28jF4U5nFY67+KbOj/DAdGNIlgIKDg2F lmAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=VTjkGMpau5/qRAdXn0AI5h8erS6BqzJeV7Kg59cVfQA=; b=RZ2yMFiUrEVHMc7P+OF3c6FqodUl4f//koOCsa3yvPXrWdVeMhKasjWJP6rtzQpq+J T2ldJdN6fw0pCZ0kA3SQhgiyosdhGHX0uqSsyX0l1p2rQr50Lqb+Bnp2SJGPjRxSgzPv R4hAyT8qnU4Q8D1q9nLxO3ZssuWWo6MB0u/X8BmKrXBYSAQbh7bM3vmBmACnM5/6pw5u LcovuTW4TYvnoox4BY1LdP1eC+7q5Rk9e3oyJQEwobFpAOgwdds6j5vMAH3W4W8G5Lt3 UfpjW2GdXf45kKm5CjKFT26GqofPNycsSj+G4eaCtW1Dy47oc8Oi299WUYXQNeVUA1M6 75Fg== X-Gm-Message-State: ACgBeo2OQUKYsUk8a2SXlGaarSaqk8qtbnIHEZaP8N9Tj6A6thVjFUNO W8wo/Y6oYAgp7KyOQnIE/Ol/vQ== X-Google-Smtp-Source: AA6agR6YVxd1GqkYJZb2vCNU9Na2hZJBEwqWFfETlz+jgEblX/6iRSkfaYv+JTOwOExVYOZfxz5+ZA== X-Received: by 2002:a2e:b8ce:0:b0:261:ada1:d803 with SMTP id s14-20020a2eb8ce000000b00261ada1d803mr6901699ljp.143.1661881933438; Tue, 30 Aug 2022 10:52:13 -0700 (PDT) Received: from krzk-bin.. (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id z16-20020a05651c11d000b00266461bf934sm653420ljo.107.2022.08.30.10.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 10:52:12 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] slimbus: qcom-ngd: use correct error in message of pdr_add_lookup() failure Date: Tue, 30 Aug 2022 20:52:05 +0300 Message-Id: <20220830175207.13315-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Cc: Krzysztof Kozlowski , stable@vger.kernel.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" Use correct error code, instead of previous 'ret' value, when printing error from pdr_add_lookup() failure. Cc: Fixes: e1ae85e1830e ("slimbus: qcom-ngd-ctrl: add Protection Domain Restart Support") Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Correct typo 2. Return 'ret' instead of again PTR_ERR --- drivers/slimbus/qcom-ngd-ctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 0aa8408464ad..f4f330b9fa72 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1581,8 +1581,9 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) pds = pdr_add_lookup(ctrl->pdr, "avs/audio", "msm/adsp/audio_pd"); if (IS_ERR(pds) && PTR_ERR(pds) != -EALREADY) { + ret = PTR_ERR(pds); dev_err(dev, "pdr add lookup failed: %d\n", ret); - return PTR_ERR(pds); + return ret; } platform_driver_register(&qcom_slim_ngd_driver); From patchwork Tue Aug 30 17:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 601459 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 A17A3ECAAA1 for ; Tue, 30 Aug 2022 17:53:44 +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 D5CA8169C; Tue, 30 Aug 2022 19:52:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5CA8169C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661882022; bh=09/NREPA79wQe5lmUCoDQ/jYhRDi/glDg6CTRgndM0Y=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LEYkgZEh5k5gew8Ar606aUDAhTRv0KPQqbibs4hxX1YZ4SgglDPoWKG1MeCZF3EIF wr9tKVmF2t/lU3y9svYcSMHNlw3+08A76EwKS0LDiJHSjTGktZzGnngJ9pJPpLuUMc eSDJXb4pifsMii8mqIDcDhdXhr2xOX4ryuq/26NI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5F656F8016B; Tue, 30 Aug 2022 19:52:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 806EBF80525; Tue, 30 Aug 2022 19:52:24 +0200 (CEST) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 20DFCF8016B for ; Tue, 30 Aug 2022 19:52:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 20DFCF8016B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Rrxh/TS3" Received: by mail-lj1-x231.google.com with SMTP id bx38so12157134ljb.10 for ; Tue, 30 Aug 2022 10:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=3y3YYNjG4SIll+4KRGX+EDIiHFSP98/0RDSZ0UDqAXc=; b=Rrxh/TS3FWVNU8y41gAtxxp1CRU75bRvzDTANnlUteoF/ovurrUMSNm9Yba5XpSq1f H9R8AjL9HUgEikw/mKRZmcUZgovaaSLfhvqRWTe6HJlU12QMDCWywCCYHIF9DwB/G6lI JTCGDT5LVGV2J9adV3BVXpiwSgyVRgYilju2pZ9hIcA9RMiJjf6PcvcnIXsQhl804zvS AuRE5oR9kPjiUW8KXwLyJIpVNt91qCMlblsdbD0/0zjfu52Q+HO1GN2JLriw5Fxy7rLx wZ5TG1ag8OOL9Xgu67kbNfFN94Pky8QsLaBUlwnE+f4FX4sZq/5rEf/4zaH7PR15m/Si 25ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=3y3YYNjG4SIll+4KRGX+EDIiHFSP98/0RDSZ0UDqAXc=; b=veBbotP2Weg0oYKPcYRmvXmIHSvZcBRQL7mfm+YzQ5muKWaOU8tKKmaWdela5a4drG o+4dKKTYf/MnMNZ7Gn6yW1/G9n2jw8reKnBBr0av8XtbT012JgZaDyjpaFNFBY7Xx0Yv D4lLDGwunIwoAYXNAco1qdvsvCfcDGetqplm8q+TGDci7Oo/dd1hhrDaeWTmWfYN1AMY M5klXhfuOZzUcwbeIAg5VPzVCDo/MAp7EDh8CFN16hQQIABxzVccmQFASH4ni8Fo01bl py7g2dlit4u2Wbnn8oIHYgJkSYa42RrkeWkxI6t82jBS0bXBiXmxBeihYMlmRBs7TNAQ PDPQ== X-Gm-Message-State: ACgBeo3MrkSqJHam99+W76OlkAukfcxrc89Y7M5hkmFLDDo5KcW85Zc3 rT+oQkVtePYt3+7J4+TfNWSB4A== X-Google-Smtp-Source: AA6agR6aBzjax1OJ583UbgWEAsw1wjuLmZGIkw+bcfOnZZOUr6WPMhITL1nEpYPpzybvIaw+MGsTmw== X-Received: by 2002:a05:651c:105b:b0:265:ca48:d445 with SMTP id x27-20020a05651c105b00b00265ca48d445mr2491150ljm.300.1661881934701; Tue, 30 Aug 2022 10:52:14 -0700 (PDT) Received: from krzk-bin.. (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id z16-20020a05651c11d000b00266461bf934sm653420ljo.107.2022.08.30.10.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 10:52:14 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] slimbus: qcom-ngd: cleanup in probe error path Date: Tue, 30 Aug 2022 20:52:06 +0300 Message-Id: <20220830175207.13315-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220830175207.13315-1-krzysztof.kozlowski@linaro.org> References: <20220830175207.13315-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Cc: Krzysztof Kozlowski , stable@vger.kernel.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" Add proper error path in probe() to cleanup resources previously acquired/allocated to fix warnings visible during probe deferral: notifier callback qcom_slim_ngd_ssr_notify already registered WARNING: CPU: 6 PID: 70 at kernel/notifier.c:28 notifier_chain_register+0x5c/0x90 Modules linked in: CPU: 6 PID: 70 Comm: kworker/u16:1 Not tainted 6.0.0-rc3-next-20220830 #380 Call trace: notifier_chain_register+0x5c/0x90 srcu_notifier_chain_register+0x44/0x90 qcom_register_ssr_notifier+0x38/0x4c qcom_slim_ngd_ctrl_probe+0xd8/0x400 platform_probe+0x6c/0xe0 really_probe+0xbc/0x2d4 __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x12c __device_attach_driver+0xb8/0x120 bus_for_each_drv+0x78/0xd0 __device_attach+0xa8/0x1c0 device_initial_probe+0x18/0x24 bus_probe_device+0xa0/0xac deferred_probe_work_func+0x88/0xc0 process_one_work+0x1d4/0x320 worker_thread+0x2cc/0x44c kthread+0x110/0x114 ret_from_fork+0x10/0x20 Cc: Fixes: e1ae85e1830e ("slimbus: qcom-ngd-ctrl: add Protection Domain Restart Support") Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. None --- drivers/slimbus/qcom-ngd-ctrl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index f4f330b9fa72..bacc6af1d51e 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1576,18 +1576,27 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) ctrl->pdr = pdr_handle_alloc(slim_pd_status, ctrl); if (IS_ERR(ctrl->pdr)) { dev_err(dev, "Failed to init PDR handle\n"); - return PTR_ERR(ctrl->pdr); + ret = PTR_ERR(ctrl->pdr); + goto err_pdr_alloc; } pds = pdr_add_lookup(ctrl->pdr, "avs/audio", "msm/adsp/audio_pd"); if (IS_ERR(pds) && PTR_ERR(pds) != -EALREADY) { ret = PTR_ERR(pds); dev_err(dev, "pdr add lookup failed: %d\n", ret); - return ret; + goto err_pdr_lookup; } platform_driver_register(&qcom_slim_ngd_driver); return of_qcom_slim_ngd_register(dev, ctrl); + +err_pdr_alloc: + qcom_unregister_ssr_notifier(ctrl->notifier, &ctrl->nb); + +err_pdr_lookup: + pdr_handle_release(ctrl->pdr); + + return ret; } static int qcom_slim_ngd_ctrl_remove(struct platform_device *pdev) From patchwork Tue Aug 30 17:52:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 601082 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 CDBEDECAAA1 for ; Tue, 30 Aug 2022 17:54:07 +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 C9FCB16A4; Tue, 30 Aug 2022 19:53:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C9FCB16A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661882045; bh=E4KgCSBFUe40RGwc++ui/SvzQSItuqwlYZq/fp/UwH4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vbQ+0JMviolkJzAtmmgV9fpKaFFygBV1+olF626CI553FQnJvRNrP2PPbUk+PpYmc VL5BvjuPBTMci2dAOjvCpBaqdhJXxM42lHUZwPP0YnqSsIvoB+Z0coAS5XTZwsuX9K RyQczVWfp3YllJ+v05Wt9gbWTazUACPWUASKv4g8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3EA1FF800F2; Tue, 30 Aug 2022 19:52:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C781DF80533; Tue, 30 Aug 2022 19:52:26 +0200 (CEST) Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AE6D5F800F2 for ; Tue, 30 Aug 2022 19:52:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AE6D5F800F2 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ewGMkAia" Received: by mail-lj1-x230.google.com with SMTP id q16so12171716ljp.8 for ; Tue, 30 Aug 2022 10:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=sc5HxHmlEPh4tH86ykJVfO3JOxEms3jA1Un8zaoNfDc=; b=ewGMkAiae9VuZkt4oRyIeJ/oPXeBsBitYVe3mfJD7hFMno1cINAZb4OxH2DS8r+EAn i1OkVYlRf9fHLgBcAAfduWzaNibqKm5TjARI9LTYey03wRkAX/3NR2oFjVmNoh4eSJ65 0yNRuTNsRz51WGkG4aHctkKtRQeNXyY3FfwxE9jYmmFC4GXL8mmvr0DU06/OwMqBDYEQ 4mA1WcjpJ+wsOH2uuAlTqCLhHjFj/Y65dWMFWkFDMpIkT3ZqwZNA6R2H6vgImijTynGh Ymzg8lYvhv7Slk8oUSiyu2uWVL4A6nHoShpudcoCs1SO7reDcunMRvZkudjbA592vsBk Yl6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=sc5HxHmlEPh4tH86ykJVfO3JOxEms3jA1Un8zaoNfDc=; b=feRBn84XvPAxymMPiyeriUZxIYTbqdVUKf9vhp9A3EcxsQ7IVxvmzXXbTKI8ow89N8 kDArsw4vReIyNca3Y7v3E32hnGb4bg/sMzkm4GmLT08ntwolAc4BetXt3cElFUJGxRyh z0cdrwDJzZZ7P8oeGWdTncJd+EGJOVtifGC9eiC3XBqHIypr7cRemVZ2kijVgDVwcpIS PdojpCOK9rnDdH+O/4007s0T3Ibf0LMIcXyWH2rI9aE/4aTp9T++0C1iZmP6kqzEno9A NPvEDv8vsdlcd7noVWuEp4j4d1mrbmfsdQ8cSrKzQvyeTl8k9aLaqcbofdv+A+NtaWzR /2vw== X-Gm-Message-State: ACgBeo18NM1pxn1U++d7FJHs8oKDLS0W+gGfBOZkT8vXFjxUjGkdhy9m aFNwXPMiy0qIF+175e5QuUjoHA== X-Google-Smtp-Source: AA6agR7kEED4eOUmvqvRHvp6dhNWSxVrTH8RHc95EoPsVY0hEEJFr94M6PDkfztbkEiF3n4pWIdU4A== X-Received: by 2002:a2e:b808:0:b0:266:52d9:ac6a with SMTP id u8-20020a2eb808000000b0026652d9ac6amr2201215ljo.14.1661881935998; Tue, 30 Aug 2022 10:52:15 -0700 (PDT) Received: from krzk-bin.. (balticom-73-99-134.balticom.lv. [109.73.99.134]) by smtp.gmail.com with ESMTPSA id z16-20020a05651c11d000b00266461bf934sm653420ljo.107.2022.08.30.10.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 10:52:15 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] slimbus: qcom-ngd: simplify error paths with dev_err_probe Date: Tue, 30 Aug 2022 20:52:07 +0300 Message-Id: <20220830175207.13315-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220830175207.13315-1-krzysztof.kozlowski@linaro.org> References: <20220830175207.13315-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Cc: Krzysztof Kozlowski 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" Use dev_err_probe to skip printing of deferred probe errors and to simplify error paths. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. None --- drivers/slimbus/qcom-ngd-ctrl.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index bacc6af1d51e..cec11aa106bf 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1543,10 +1543,8 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) ret = devm_request_irq(dev, ret, qcom_slim_ngd_interrupt, IRQF_TRIGGER_HIGH, "slim-ngd", ctrl); - if (ret) { - dev_err(&pdev->dev, "request IRQ failed\n"); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "request IRQ failed\n"); ctrl->nb.notifier_call = qcom_slim_ngd_ssr_notify; ctrl->notifier = qcom_register_ssr_notifier("lpass", &ctrl->nb); @@ -1575,15 +1573,14 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev) ctrl->pdr = pdr_handle_alloc(slim_pd_status, ctrl); if (IS_ERR(ctrl->pdr)) { - dev_err(dev, "Failed to init PDR handle\n"); - ret = PTR_ERR(ctrl->pdr); + ret = dev_err_probe(dev, PTR_ERR(ctrl->pdr), + "Failed to init PDR handle\n"); goto err_pdr_alloc; } pds = pdr_add_lookup(ctrl->pdr, "avs/audio", "msm/adsp/audio_pd"); if (IS_ERR(pds) && PTR_ERR(pds) != -EALREADY) { - ret = PTR_ERR(pds); - dev_err(dev, "pdr add lookup failed: %d\n", ret); + ret = dev_err_probe(dev, PTR_ERR(pds), "pdr add lookup failed\n"); goto err_pdr_lookup; }