From patchwork Fri Oct 11 13:09:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 834652 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59D5521859A for ; Fri, 11 Oct 2024 13:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652175; cv=none; b=V1JoLiT0aXkUYvjO4591LJO7U6Ok/P6M8i4nXsOpR2LP57Y+1Z12heO992tluQ3m3xMwWqf5rCOlxPesc7UNjCM+6EFiB02yfCsL9M01UV3vmN4vkAANu/hiEq2bkUpKKLsrcaShwIUvmODafvruoPMCIxmJ7kZ47zgFhd08+l8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652175; c=relaxed/simple; bh=Efl7CZDOuECv9di8D9DhDkfW/8hB3yUHg2An+aKkbRk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oFCC9Ba2I0+wvRbx/88hNhhobpXvrnHhRmhTCV0cwdVrjQJa1WRjYj6o0CjdC7Y3jfZVkXs3hrN23kXIUnSb2hlCwvBJSXdzHd4Q2P1VB0M3X7sRoYnSqwrinREFY6e3MJ2Qm1wJHIosKDPFUNAidSdROEDFeJ5BjaTYkUTYp+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=QTPyGYs4; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QTPyGYs4" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-430576fe517so3557545e9.1 for ; Fri, 11 Oct 2024 06:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652172; x=1729256972; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UG3Qm2MgrjH9dMYem/mVTYMGse1VSn0DCYfZp91tfJM=; b=QTPyGYs4dsy+1tt2x+hAUL3I3EU/j3beafz6/4jzi9n0n8qiJnZ7O/ycNq6TN6ffFm au618pMq8awfdBDElC42RweNXBJ825D4q67XyGE9r5QJIruHlkjDMGLwDbxTO0rCJiih RwCHrR9DukpWYMuMIx3ub60l6S1KT5aa+SYEIOo/4beM5vWE0Ia+QPpI4MUxfDyI7Nud SnXBIATp52hlVHVvmBiUThtrdgEsOgZDKwEfMtbg14yeeZtW1JiA0oUQosTHh7OuEo6g hI6Q6aZBgnr84U3XMxGtUYjk0jG8VZW3IqNew0mx+E0LaTC+MoQDFuyni/HEP2q5KqTG kgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652172; x=1729256972; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UG3Qm2MgrjH9dMYem/mVTYMGse1VSn0DCYfZp91tfJM=; b=wtjvDYFlt6dZUvekecp4Ms9BJVi8fjWt+lwuo87ntfs86sgMvEMUAk9675w19xfVS6 3f/xqgTDMcVh/Mmv+nb1ghyZKBibTDKljQpeYhDU1MN031jh5q8XjVOLh/4/1Q63X4nR PTSqMLa4RWCZfZ/vaC6PayyULAw6WNMvARCq5GhoYLhN0ms+4w8SFcuUTYa3vE01uUxi Fe8Vd7m4SygL/5nba2etOWiODT1TrrQIAXm6r2WMkkpPMMHtpgCDeTAHRnePdmV+Az36 5kgd6z+KdNQ15N5yjn8OQ8G4hbaItnmBoqDirTMlYKZwQxhypo8w0LuQWRdRPA1l4JwT h+5A== X-Forwarded-Encrypted: i=1; AJvYcCX7ztIqAXv6FwXPFPivrKtGvAHcQ69KzVczOT0DVwWxgDDFqaJuKYczBLQwxB64XfgvpRC2JyDUMZYL97Sr@vger.kernel.org X-Gm-Message-State: AOJu0Yx1N/3UDSrSSZM2Z7qK5P9SsRkAWdVxAp2TDmC9/tvjut9ZWcUf vhUsFhKxXLghiAKmu6I1OtE7+9bgPNVZAdGPTTkD5OdBf/nDDvziqSGGvDoIPsM= X-Google-Smtp-Source: AGHT+IEOpwQ5zbShnH9q9k+xPE2cbuqtLIvjMJ9Ws3a25NNyN/fDuxegI1VMFli5L1E2DFcgasgTyg== X-Received: by 2002:a05:600c:470e:b0:42c:b55f:f4f with SMTP id 5b1f17b1804b1-4311df6050dmr10163155e9.6.1728652171681; Fri, 11 Oct 2024 06:09:31 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm41621835e9.12.2024.10.11.06.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:31 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:09 +0200 Subject: [PATCH 01/10] remoteproc: da8xx: Handle deferred probe Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241011-remote-proc-dev-err-probe-v1-1-5abb4fc61eca@linaro.org> References: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=996; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Efl7CZDOuECv9di8D9DhDkfW/8hB3yUHg2An+aKkbRk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSN+kmXApJYRDzFRCX+0jqfEjq+GDgfNftaPJ TsD8ge3KYGJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjfgAKCRDBN2bmhouD 192oD/sGhh13Qoc/TkSae9x65oSc+HxSm9V7PJwKGu3DqHEc83mI/INO5DOmzeuJXa5+gsEeidj 8piYBZOX25DlPbkCH7kd+hSnfX0bax7AodU+rQM1VEApgFl48A56xAp92mRc+OG7fEYyCj87PiZ xQmH4U6VWs5vpPouGUnhrXo+pS7M9tTRwSrATGH951t6mfzl4PB2F1ZhadPbXB4mdJIzYqe0lbs DYB8pvJASagSI2mkaTOPEXLRXKwGZhMKJEqhvEHvie+n4Dm2du0jVk3OtnHEQz353V7XhC5fzrh KPY7HuQ8gvFk03HTnT8MRFLT6b4ZnEYcErRj3V5d5ZtmpnNKP7fYF6l4lv0IM1kBU3H6OjwZXRX Aij265jfsD3qeVYYlsdiUQ6Zq+ewFZ7ERB8rHQDg1gKmI9lNIOIyXR1s++SwfYd62PgP/+onGtl ba2givXln5gp2ZKim51jE/Ub3Pdz+mRLdabOf+WT0oOc7JatlI67Spz0nEy3MzRDbEYLLHadrwq TC51jUdqt97gwrHM9aApT3dJPfinKnhaKsm2cKEqqOKWhBKfAme92dmgDnb2N7VmHd9dlVLABDg sbTfyigBgHHHoPHFhX6Vne7lU/FNGQxZqixOkPud5KqOsminUM+IjB9zlPV1FSEudXjQzFWpMCE axDRnZ4Mm1W43Lw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Don't pollute dmesg on deferred probe by using dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/da8xx_remoteproc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index 8770d0cf1255f8b618283965e1cf913018fe173d..f8121682ae9a2aeee560d7f012bc68d2cd53b5f7 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -265,11 +265,8 @@ static int da8xx_rproc_probe(struct platform_device *pdev) return PTR_ERR(chipsig); dsp_clk = devm_clk_get(dev, NULL); - if (IS_ERR(dsp_clk)) { - dev_err(dev, "clk_get error: %ld\n", PTR_ERR(dsp_clk)); - - return PTR_ERR(dsp_clk); - } + if (IS_ERR(dsp_clk)) + return dev_err_probe(dev, PTR_ERR(dsp_clk), "clk_get error\n"); dsp_reset = devm_reset_control_get_exclusive(dev, NULL); if (IS_ERR(dsp_reset)) { From patchwork Fri Oct 11 13:09:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 834651 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBDB3218D85 for ; Fri, 11 Oct 2024 13:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652177; cv=none; b=X2m7j8cGvi3dV3GDOasPsqVJ5MFes+Byrt9eEjxR9ZIqb3nl2IkYP7vKNGwlS5+5iSthfoyUmb40gEq0D9dvFdACcNn6orxsIdUAV6w2FQeYorEYqEX4wam0ROmk1+/RWfJDG6PZltE3B+OWBNO3uH3RLFY/JVg4NPesvYRhoOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652177; c=relaxed/simple; bh=KVaLBBlbh3dYDdR8ks3ennYPPEcGrZDyGNQYooRo1Po=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QDMo6Pw+7EIeny+eKBYpCH3C2uKkxRx2OAByJJsbcOGkyMKqRAG0Rj+iCSZBC3kMAet+LAU8VxUIlBfk9xFVUs+Utk3iT9dKb5tGxMm89fXqznMhDrCW0dBksmneaXQs78qSn+Ms1vYmk0Bc/Tl5dB5g3c/zNZrqL3dzefYLlIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IBAnLzRB; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IBAnLzRB" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43111bdd54cso3270465e9.1 for ; Fri, 11 Oct 2024 06:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652174; x=1729256974; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=b7Nvg3BoaosiBkxdS8e0yItpPTXTuqmEuWUS4CnmA1o=; b=IBAnLzRBtcYbQl0yLb+KvekJEcFwhX8E527w+Kas+7ph4LjwsyzZw2as6kh7/rmhYU BHcbS4kUxLigvH93r8a6NQn82EoprAYqSdF2EJoTulfML3mnMv1FPs7dVUPMwB92eh/e UbWaLfuLBIvtbQZ7+hZkpnwncwEdcLiXYqZ4WdP0cDNIySrDKRqiSviZezr8VQ3oky8n TG0/qRZyaovqpL10AbZdIxc3RD+tCsycx1fd88MLkFgnCmbeQK7pB1SRoNuo8EwstaR2 y6aWiff67XCdoAR2XiyZbyvKiP3ha1ZpXWU/XjWiBd9p6KCK2FbErJV2eHzJrB8uVsRR ifMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652174; x=1729256974; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b7Nvg3BoaosiBkxdS8e0yItpPTXTuqmEuWUS4CnmA1o=; b=bRu7j848Tw+aMZDf10fxwZve+uTaHAYVJ3wOnRdghoLFFOtIkHGseDA+IvqkK7WYsU jZvr+8RUNvwtd+xuA7YopMHa29ESaJ1BP+ybe6/ssKqoehZRBuXS0ipXlnlR90DmWzaM 4NQIoYCtBhCTDmSYt914sP0ufdXMC3nKRRjHA10IQ9j4sHh1qi+txWgYjblUSo/pDIr6 wRVfLpQr7iudWiqkADm4l6XtJNITEcFkkV/S643ULOAhiSJDSfZwyc6dyaz1vyC1XNy7 fzxgQW4rZhI/WGK3kht8Z33bj4Esq3tZryKcjQ+lvTVq4dBISyIo5FFTrnC0MyFO1tm2 WK0Q== X-Forwarded-Encrypted: i=1; AJvYcCVnz4sZ261ze3Ly4grmn0XCobTU1LhZJittx593flo2bEgthPGnf4crwQRfReGGOhJsDcaRVeB5Tok3C+vC@vger.kernel.org X-Gm-Message-State: AOJu0YwNEcnal9yHGsTR7K5Bt+p4p2BIdGrpULYFHGNaVYlxXDA3i/7c ellMDqcKr1tudQmBfStIf4SLf2GXLoU/YKqN4Ogb5WvEFC9atZpeOiWb42EK8qE= X-Google-Smtp-Source: AGHT+IGp60E5RkMJO/FIg6S9LUWNU8V7pORyL0cemcWxhunxyvPzt3qT9kHRqbODDd/u+T77QidHmg== X-Received: by 2002:a05:600c:1ca4:b0:42c:b9c8:2b95 with SMTP id 5b1f17b1804b1-4311df5bd1emr10207265e9.6.1728652174022; Fri, 11 Oct 2024 06:09:34 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm41621835e9.12.2024.10.11.06.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:33 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:11 +0200 Subject: [PATCH 03/10] remoteproc: ti_k3_r5: Simplify with dev_err_probe() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241011-remote-proc-dev-err-probe-v1-3-5abb4fc61eca@linaro.org> References: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4503; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=KVaLBBlbh3dYDdR8ks3ennYPPEcGrZDyGNQYooRo1Po=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOASFHiQkIljzwn8voo2jKvmxjkX/0FrzW0u 3MJxiD/oGyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjgAAKCRDBN2bmhouD 18+zEACX0aUTuAeU2RO+h5zjZGuToXBnD6yjf8dX6/8mT7pT8EIYK0/Vv/JSJ6x4Hd+fJ4zvUtq od2BzE9DcORbz+0fPdkoAa2RjZO27aBX5gNwX1yXUYC/m9F5Y+pG7zIRjPl5vQ9u0JPk8v5DRgm XtHAWWHP+lJ/UwSC54qJ/lJSxuVQ4CW9xIqAPITwyRl6RrG+pQn32w1uQ5t5BxmlMK/xf/GxB6M rMkIM4rPynd4IYmZHpqMCqyvzgmGEVaFW8P95pmmOQMsRHbOGXx9eRXBvyHhHx8LSeRZu+GOuop 6n2B3XG1JDoLB5IaJiQVBzR4Lvx3sSMvZNzjblZIvcycLbyNOR04fW/IH3zfE8dbQinZBZVHvXH QHPByK31uMF7bm9amEQYsMPaQaEt9a4NSoR7b6MDncNWm/4BW4rjUbNPdZYcUFiEMqRC/VaYyQL pPxJbjdoVwo+nDH3VL3zFQ13HhkLLoNFkTjVTH1Dm0w4YKDlFvFDG+FpFn29fNl2GJjuXrpJQfF u6MfOud5wrHueRXlgyxO6qv7Fwv+uBsfXsKb33q0+ZGnqcY86pX6B3CDnNtufTESWPQLeSw4R6S JV/hx5yyB1CFjH916wp2bYYSmAnlT2PHboe36bRRXWLFRvu5W8rcpMxlaUHjrX0+17cO2TadrT7 uuQAdz/9NBn+EeQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use dev_err_probe() to make error and defer code handling simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 69 +++++++++++--------------------- 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index d0ebdd5cfa70e1dac782f5e131a0f19c9ac096d9..5a2e0464e1b81e3d4571a466643f08a53ebefc0d 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -1557,11 +1557,7 @@ static int k3_r5_core_of_init(struct platform_device *pdev) core->ti_sci = devm_ti_sci_get_by_phandle(dev, "ti,sci"); if (IS_ERR(core->ti_sci)) { - ret = PTR_ERR(core->ti_sci); - if (ret != -EPROBE_DEFER) { - dev_err(dev, "failed to get ti-sci handle, ret = %d\n", - ret); - } + ret = dev_err_probe(dev, PTR_ERR(core->ti_sci), "failed to get ti-sci handle\n"); core->ti_sci = NULL; goto err; } @@ -1577,18 +1573,14 @@ static int k3_r5_core_of_init(struct platform_device *pdev) ret = PTR_ERR_OR_ZERO(core->reset); if (!ret) ret = -ENODEV; - if (ret != -EPROBE_DEFER) { - dev_err(dev, "failed to get reset handle, ret = %d\n", - ret); - } + dev_err_probe(dev, ret, "failed to get reset handle\n"); goto err; } core->tsp = ti_sci_proc_of_get_tsp(dev, core->ti_sci); if (IS_ERR(core->tsp)) { - ret = PTR_ERR(core->tsp); - dev_err(dev, "failed to construct ti-sci proc control, ret = %d\n", - ret); + ret = dev_err_probe(dev, PTR_ERR(core->tsp), + "failed to construct ti-sci proc control\n"); goto err; } @@ -1717,11 +1709,8 @@ static int k3_r5_probe(struct platform_device *pdev) init_waitqueue_head(&cluster->core_transition); ret = of_property_read_u32(np, "ti,cluster-mode", &cluster->mode); - if (ret < 0 && ret != -EINVAL) { - dev_err(dev, "invalid format for ti,cluster-mode, ret = %d\n", - ret); - return ret; - } + if (ret < 0 && ret != -EINVAL) + return dev_err_probe(dev, ret, "invalid format for ti,cluster-mode\n"); if (ret == -EINVAL) { /* @@ -1740,49 +1729,39 @@ static int k3_r5_probe(struct platform_device *pdev) } if ((cluster->mode == CLUSTER_MODE_SINGLECPU && !data->single_cpu_mode) || - (cluster->mode == CLUSTER_MODE_SINGLECORE && !data->is_single_core)) { - dev_err(dev, "Cluster mode = %d is not supported on this SoC\n", cluster->mode); - return -EINVAL; - } + (cluster->mode == CLUSTER_MODE_SINGLECORE && !data->is_single_core)) + return dev_err_probe(dev, -EINVAL, + "Cluster mode = %d is not supported on this SoC\n", + cluster->mode); num_cores = of_get_available_child_count(np); - if (num_cores != 2 && !data->is_single_core) { - dev_err(dev, "MCU cluster requires both R5F cores to be enabled but num_cores is set to = %d\n", - num_cores); - return -ENODEV; - } + if (num_cores != 2 && !data->is_single_core) + return dev_err_probe(dev, -ENODEV, + "MCU cluster requires both R5F cores to be enabled but num_cores is set to = %d\n", + num_cores); - if (num_cores != 1 && data->is_single_core) { - dev_err(dev, "SoC supports only single core R5 but num_cores is set to %d\n", - num_cores); - return -ENODEV; - } + if (num_cores != 1 && data->is_single_core) + return dev_err_probe(dev, -ENODEV, + "SoC supports only single core R5 but num_cores is set to %d\n", + num_cores); platform_set_drvdata(pdev, cluster); ret = devm_of_platform_populate(dev); - if (ret) { - dev_err(dev, "devm_of_platform_populate failed, ret = %d\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "devm_of_platform_populate failed\n"); ret = k3_r5_cluster_of_init(pdev); - if (ret) { - dev_err(dev, "k3_r5_cluster_of_init failed, ret = %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "k3_r5_cluster_of_init failed\n"); ret = devm_add_action_or_reset(dev, k3_r5_cluster_of_exit, pdev); if (ret) return ret; ret = k3_r5_cluster_rproc_init(pdev); - if (ret) { - dev_err(dev, "k3_r5_cluster_rproc_init failed, ret = %d\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "k3_r5_cluster_rproc_init failed\n"); ret = devm_add_action_or_reset(dev, k3_r5_cluster_rproc_exit, pdev); if (ret) From patchwork Fri Oct 11 13:09:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 834650 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BD4C21948C for ; Fri, 11 Oct 2024 13:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652180; cv=none; b=OTn9qMCZ5iHZ2FmyWUi4q6ReZ1Fj9Lao82X27/3icPvNOo3CM+hxAFVT4OO6yhZAchOhoz6FxvlOXoWu1w/25VuNv/713DOffjrr58WuWryc/DGTB28D8/n2woSNZ9KjcxdEzQ7Js1UmhyxOVfcD2Oo0x1NGdMcSohEVX33/dtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652180; c=relaxed/simple; bh=7kdOoNfMlZbYPfmRo7BU7gqeehZO4mpSsH4l4kVhdVo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HXRzZErbQ1/m0tmRZQpkk/In1HbI7EEW6cBXsFpujEcsV3Ch2clhojnSyJGwryU5bFPBQX7jf0KnCRXPtbYExUNJQIMhPvkeuVh0mJhCAcDibfk+8ftxIqKLDvAztydbtQjlaKEBjpY+51+nlmamMr3uw6oXwK1hw5pPWuhH6gY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jd8R1O43; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jd8R1O43" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43054ddfd52so3247285e9.3 for ; Fri, 11 Oct 2024 06:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652177; x=1729256977; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1REIJgEpdIx863Xckau1T4eHu3s++vgqgq7X+I/+RaE=; b=jd8R1O43/eJ7gUCFXMpAqfNeHj7nZuQC6fY3b+XbeN2gg+95IERI55nv2DdQiaQX7z XM1ZH7ucZpcUlIg/1e5lbCpoCFosP+YaenJFN5+uwCL3fkZU69sfpQh6MV8HdRCkO2lW yGlgkNWkZHKSIT11119pSHuEmYrQji9ruSHKNsRqsZfTZhEB+BbUfURQ3JywM7Glr1ae alfdDbY+I3z7bDAWDvch76FLQuyrSTt/i73WBUx2FAmAadz+YP6I3dII/BL/vYQdFRhc ctmQPIagcLd+bLDcZgaPB0oSKbzum3TvJDajLkFwG4jNGtzHO3Jn+fXYs9v9H1XVN8M3 yi5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652177; x=1729256977; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1REIJgEpdIx863Xckau1T4eHu3s++vgqgq7X+I/+RaE=; b=ZO8BcFhVEwXzskMZzM0IGcLBQA+Ekk9OWhsw7gNGJ5KiJbKn4FuTtwKtRq4gua7vBw NHAYEyhBcUKYlfL3pBpj/iEgjeMXuKK0UR7TEtrve6xdSdQX3q6ux1PzuSeCMjUfx/SJ DgL75YryZm5hFlrSNBHwBcv9cWe8hGPr3cMtAVrAQ1ZqG6+3OmET4e68MNPKmZavx+Ax wi/4ViAKrWhkEn1GSYw1Kp9eKPNFKo0SfvGOBMbScuKiwSv2MQtqu/fi9uRNyOHZEbvJ ST7aBOpNgYkZweH4M+3bFpBt1fu8ssnSQJHOqxsKwpoZzY0uV0isjv5rsfWGiHWFsEG0 rHyA== X-Forwarded-Encrypted: i=1; AJvYcCXJf8zWvCUcw3NsQFBP4QHE3QNc2g9tgWR8Y3LfBCIlZoUF1dHH9swJ/0fdwmUbhh6OXCO8gMPBQ7HK2gH1@vger.kernel.org X-Gm-Message-State: AOJu0YwA051u9Lgc7+4zjQzQYvn8lfgsQmEcWCozOZd2STuGjUE19xuU kfn9fV1Q4vSBrDRODTeEmUwGZsgtePUWqyNUQUFqlwEpNtkfhSekd9ryhAuGa1A= X-Google-Smtp-Source: AGHT+IEEkKY/6b0TIyEQcSfAmiz8qvdUcFi/UqnhV9Vtt0lRZyZBwwpEnou/+4xo35nG5z92Ey7g+w== X-Received: by 2002:a05:600c:4f85:b0:42c:b995:20c2 with SMTP id 5b1f17b1804b1-4311ded2070mr9874195e9.3.1728652177461; Fri, 11 Oct 2024 06:09:37 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm41621835e9.12.2024.10.11.06.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:35 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:13 +0200 Subject: [PATCH 05/10] remoteproc: qcom_q6v5_adsp: Simplify with dev_err_probe() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241011-remote-proc-dev-err-probe-v1-5-5abb4fc61eca@linaro.org> References: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1526; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=7kdOoNfMlZbYPfmRo7BU7gqeehZO4mpSsH4l4kVhdVo=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOChz9N3XKg18dB5jGjrrzdkT0/FM1v/WZMT Mg/6ZCzNRqJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjggAKCRDBN2bmhouD 1+FCD/9OQZ35fwISw9kTwuj+H3KepvqgGpP5+XA36+ilYkXTMPLj0c8xqbs5Vv3xldDmUt3SMca ISqxeZnjELmzQt1c2kRIgqC18EevRbmZ7KUpqCmUTauDlE8eNewjUE9m19j3KxVBHr2Msd6apKh e7SLStsvyoyXsodwnvkZSxhV8zHmnDF1nO63PsiC1LGe54UyuVpEaNLPpHibzBYfr8rA+y3WYZc sh7ah01pZxWqhkcVPT0gNXxw/qmK23S3XLmSALGiYtv1yihK7M9lpLnNWwIYFa6Wuo36FLt1jnn oi+0WApEy+FC6cv9xsofkNZqB2PoDhbiC2XV5M1iJknbpuggR5i4Zz/pDS/yRLF0OgBYrlC+oRQ PlOzdyyU+STDh4JsYs9FFdovbuJ9XfQ9lENjKzSv8wq+anNdJ+RWMqjpw9Q8GtsgM6m2bQA1RN+ m89NyKVOm/0mebqd9uc9FZFDgrIzY80Yjf/yEwmnhkMvzCYVX9opp6GFuc14tAdmK9waz+ioWAS 0mR0vQXDJYc2bHnV9hpWA3meATPYs9DZKvEL5WBm132DeMx/R5gSpNm0+7uxMGaVzwlDCFkhcot q31hXet6OCV8BJfL1BqcX5vJIo9MNMu8t12USNKnSwPklLAMIKVsXZe6yjvv0UvTMmTrGHh9J1b 879wxj+/Q86VILw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use dev_err_probe() to make error and defer code handling simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/qcom_q6v5_adsp.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index 572dcb0f055b764f36d0da7c851dcc707bb5ff6e..79dfec517d38980e05ef0196138e6f312c84511d 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -534,15 +534,11 @@ static const struct rproc_ops adsp_ops = { static int adsp_init_clock(struct qcom_adsp *adsp, const char **clk_ids) { int num_clks = 0; - int i, ret; + int i; adsp->xo = devm_clk_get(adsp->dev, "xo"); - if (IS_ERR(adsp->xo)) { - ret = PTR_ERR(adsp->xo); - if (ret != -EPROBE_DEFER) - dev_err(adsp->dev, "failed to get xo clock"); - return ret; - } + if (IS_ERR(adsp->xo)) + return dev_err_probe(adsp->dev, PTR_ERR(adsp->xo), "failed to get xo clock"); for (i = 0; clk_ids[i]; i++) num_clks++; @@ -708,10 +704,9 @@ static int adsp_probe(struct platform_device *pdev) return ret; ret = qcom_rproc_pds_attach(adsp, desc->pd_names, desc->num_pds); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to attach proxy power domains\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, + "Failed to attach proxy power domains\n"); ret = adsp_init_reset(adsp); if (ret) From patchwork Fri Oct 11 13:09:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 834649 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B51FB21A706 for ; Fri, 11 Oct 2024 13:09:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652184; cv=none; b=JPi+ogGjp8ZaRVWY1HJjywqa6TUoTkPhrRWvvg2HEA78X7uOCW+lanFPI6+ETHfhjPXAAQIUTPpavTsusQL2i213pbxTebivJb3uMFyVyjmIsi5Pydsp/C+8RXwND74LNhfu0JjSE1NzLe+SJX0Kfv+7iNYaNbOXKoZYbgQ4ue0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652184; c=relaxed/simple; bh=pBS8TQcIAnFdQitaxFSWoWQwgTL79cVWX0zRSmeBwdc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oWQ0hz2u8qR1pzQMphE5oHlvZ8hQwSl0bmRONdGyZTRw2TLY9BkYqB830mWB89nf+K7zN+w9fFvYZ+cFa4x/Wg9nHI7dpe1BuPOgVoeOKEhp5n0kIZydReHoH5O1/kLzFYSd9ZpFy2tkkbSe3Bla3wAPqzPAC0nqKnVMqvpC56A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sGZ0qCjB; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sGZ0qCjB" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4304ea60a58so2270275e9.1 for ; Fri, 11 Oct 2024 06:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652181; x=1729256981; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=6nvL93CgMbfP8shaZG6AZK9feEPRQ+TeXPEOzrPPrTU=; b=sGZ0qCjBR4Zh1jHwA2Qk4xEFvCFwqXCHpfKG+0Zq5Ic2vKZPcdblf4fczAbObzuESe lShuTxVhagaHxPH6rpACXPfQawQnDsEmnrnpM+yR/8fhPvCAmHfsjlfcHEMUbpCFwJqr XA87wQEB5lPN04JfK8Kyi4ZWWT5N1vEYZBvqA42bhMqrZfguFydilP2v4kqprQZBXluk 0xlcZYvalU/5dGaT20dm3UCunlbu3vi9CcXC8mpMIla4qyYrWt0HaD0pfcanMqujwtkN GstA3csR6/AwisMCdBsSyeAVZq3u7gFcOx/gWzfzYpOCuckqkEnIapmxHzB7J7a/ApAY 7f3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652181; x=1729256981; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6nvL93CgMbfP8shaZG6AZK9feEPRQ+TeXPEOzrPPrTU=; b=b+X+r03+dGs5qJzq0NhGq9AjPhDWt2w7v02x5gehIfMWb3On7p+0VEGidQKIXvf1el Kq7/SjrWOj+d+z7GwBUVrxgEt6qVSFUmlRBxlADCZ5dcLswMVQVOg/+DwcHWrRys27Ga aHUob54vOXagAF1hclqCnxVbG3IVyIEVKDMzLM7LrvkUZg8xRF6lGs+7VvDYPTHrw9iz 7b7fRiWkumps+eEUbuyuwXQF1pQ0MF/ZrIOTsiDViRlsT93MReYvSef9sxMnMx1GnHI7 pmGsAIltGqaliXj2iqzMo8Wowia/u9WFqz0AFdQ+PNHnD/rVtIqgpE9JAUfNdf3EYUYY CdQA== X-Forwarded-Encrypted: i=1; AJvYcCVexXZLPWefhSCArpXHKknTewcLrvXzibkW2o01fwVVmZcLnoJPjAkbiXpCMLusQsfYLwQdSLhhM82Tu9od@vger.kernel.org X-Gm-Message-State: AOJu0YwOTLOnAzZYIMtfa9v7VUAeaCKDSJ4WnO8ZbxcYVYhEPwL9aUL6 2Ti2d7l0PtSyQintkw5vsSBkLBbMHvJrlqs5P5K+JMmS9XQe5LmRiCRHPCaXgTA= X-Google-Smtp-Source: AGHT+IH3nPKWSxkeqsGiiBuZPE29XSORIeYCMUS0ZZU3V+DNACh4zh7wpyfltKfX3S/gJ9SInhRCtA== X-Received: by 2002:a05:600c:46c6:b0:42c:b995:20d2 with SMTP id 5b1f17b1804b1-4311debc931mr9560245e9.3.1728652180982; Fri, 11 Oct 2024 06:09:40 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm41621835e9.12.2024.10.11.06.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:39 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:15 +0200 Subject: [PATCH 07/10] remoteproc: qcom_q6v5_mss: Drop redundant error printks in probe Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241011-remote-proc-dev-err-probe-v1-7-5abb4fc61eca@linaro.org> References: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2495; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=pBS8TQcIAnFdQitaxFSWoWQwgTL79cVWX0zRSmeBwdc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOEIqbUGUHYbYBQ8PjA5fdJUnrpybrUAggm+ SjFmwH7VtuJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjhAAKCRDBN2bmhouD 18vPD/93qK6STns0BgbRvtkjkDqZpyczEL4vn5MZygS7dx0x0vzynoJoKhah76d83WYQ0hYbTmT fpj+QUQ0n8uFNwULLFrYR4k1y9zgbZpffK+UfBbNr2BNUgvmKaUjY/g/v4UU611aTVwu1sKCJee X24JdEcD07ZF42Hru+acq76kRqiyfr+S1TYv6e0cXmc6WgNQUwubg1FI8rUdDXV8VgLTUFpMmsO tRUc1v9joNK+RD3RPYTdoKX/qkw9gFQFfdYOU2d6A43FeuZcgZYvDXQ2CBuk87NcHcywBQaY+lF hdQNVY61rnVFW+XVXHG/5XWHkOmYs5RqQaSrMvIAolkhULOK1fJZ8kDhPykAIlJfTmbJgwyT+q5 V8vwPNQfdb/nKhb++ku3av4xzRi+Pz8FbuAfS+jYeiD/FreN2tBNSbqzfEmSTfu4Tp+ygy1R3UW 5AXP6UaPwIJglFUJrw1wt4yrmgXflLe8xolBuOEffiiXJ7GBKWyAXKNwq3QwUZDZtzFvh/d8ZXL /5PS4qT+fRw9GkcnhS371U7+CmVpFS8HTw+1BtLgfICnCbkPVCsSGqwbCbzPkXkFjm8FTallrxa l+crJXOc6Ob/2r8iAa4NgFyeOM8bX6nEX0pKkERsKxbQ+4lfgfcgAuNHNfsIyTs8vseXd9zA2J+ mgHqffLZu2ui32g== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Do not print errors of getting clocks and regulators in probe twice: once in q6v5_init_clocks() or q6v5_regulator_init() and then again in the probe function. This also avoids dmesg flood on deferred probe. Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/qcom_q6v5_mss.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 92212892a53ea4843da62642c39413c33b4c962a..68b8172b023ee62be764ba69e07f3743ce6124e3 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -2020,42 +2020,32 @@ static int q6v5_probe(struct platform_device *pdev) ret = q6v5_init_clocks(&pdev->dev, qproc->proxy_clks, desc->proxy_clk_names); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get proxy clocks.\n"); + if (ret < 0) return ret; - } qproc->proxy_clk_count = ret; ret = q6v5_init_clocks(&pdev->dev, qproc->reset_clks, desc->reset_clk_names); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get reset clocks.\n"); + if (ret < 0) return ret; - } qproc->reset_clk_count = ret; ret = q6v5_init_clocks(&pdev->dev, qproc->active_clks, desc->active_clk_names); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get active clocks.\n"); + if (ret < 0) return ret; - } qproc->active_clk_count = ret; ret = q6v5_regulator_init(&pdev->dev, qproc->proxy_regs, desc->proxy_supply); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get proxy regulators.\n"); + if (ret < 0) return ret; - } qproc->proxy_reg_count = ret; ret = q6v5_regulator_init(&pdev->dev, qproc->active_regs, desc->active_supply); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get active regulators.\n"); + if (ret < 0) return ret; - } qproc->active_reg_count = ret; ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds, @@ -2065,10 +2055,8 @@ static int q6v5_probe(struct platform_device *pdev) ret = q6v5_regulator_init(&pdev->dev, qproc->fallback_proxy_regs, desc->fallback_proxy_supply); - if (ret < 0) { - dev_err(&pdev->dev, "Failed to get fallback proxy regulators.\n"); + if (ret < 0) return ret; - } qproc->fallback_proxy_reg_count = ret; } else if (ret < 0) { dev_err(&pdev->dev, "Failed to init power domains\n"); From patchwork Fri Oct 11 13:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 834648 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CC4C218D70 for ; Fri, 11 Oct 2024 13:09:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652188; cv=none; b=nWE12YbzCrxPj99z20xpTEcVByaaT7uPAaSI/RVrmgPC/yf5g5mO+xQ4fRvAGWAer3fNZKaGxphlEvp0Yzix66quETjocC9HKYRVDH4pulj/9Kc7jBihn1AqP/byBtg1HX39BgwZDGIelUt8y09ttKZJient1F30u5rEnrJgWkQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652188; c=relaxed/simple; bh=J4xZfv0aBPmZUKd/vkSpTrvNwZXicEmiz2DyP7s4fn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LAbqDIl1THzbJyDgS6ZEVoLg2IN6IYj00i8OAnhbJP0//kYH6dU566fU9cP+gpnVTQsxVip5uDfihUZN+JXDsodqDTKkaHvwvh70X/XcKdMDcBpeOwo0+IIBHlX4IOWKTMSPK9QCDoQxXkZNNVGIRv4Rlpv5APzEe/YJCt56vu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZnOj0+nt; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZnOj0+nt" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43115367693so2805775e9.3 for ; Fri, 11 Oct 2024 06:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652185; x=1729256985; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YqrKaOgTrk5zGkRdbTZV4VPhrGZkf7sOsanYq3cQGaU=; b=ZnOj0+ntUeDseJZesdhG5Szng8VLWmO4RB0GRubG4FTFJkBGHUo3e45ZZmXvphewGD /hLqnsXA2C64pcLf5XxolQUVJ6gYmOApKf0kU++WusyXcMph+FC27uu42fVMSHl6G1nU P961uKP9ePlLeyntm43kjjqFWn7K03oq+Db+5Agc1EYERjMiM36iJWAWfv5X9aDdCz6k 0P9Ypukt/0aEQTiQ1u5jbRii113ZlZC35ImTRqJt0uuf61I95LYLfqmuKM0qsPj4YUII HTP4P7IKNR3vqFF0VoirmJ4jg8bPTlU8kq0OhtlGLDWdiHhFl+IPGdqi5O2GwlNoq2d0 Aufw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652185; x=1729256985; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YqrKaOgTrk5zGkRdbTZV4VPhrGZkf7sOsanYq3cQGaU=; b=NOJw4LfmF2UOnghkwN3bOFcLjZYQmPMWjquXOVo3nYNxbKSkdp32VPuvW1bJSUx5Ti QXoTbn3NferB7RQNI2SSp5r+ys0q1f/k9pUcsg/IXQkWsya8owDnDVlQHsy5tBpp0udO hbdhh1GZjP0JJYjYGZLm0gG+9VOeghm9AOj9XPDAUfKOdis1PBWo9W98y//GM2SyRswQ seXDWh+6TEN1LfzdbU9JauqSmCjXucvQz3jw6fU2YuZTRnJX5TqhY4q8z9ZUdpDMh9vL YyQXnd0ykhNGk2SjPiZv8BJooFV+pN8Mze1bskHDrTO/qgKu4vja2IezbFHl1uQQoyTM 9VUg== X-Forwarded-Encrypted: i=1; AJvYcCUQD2ofYBCWA46BsbLgvtWgcX2f6HRt3ffQLcbJzc9h4DwjBZuxqcmP3tzn/qi44caDSXSpSBLCQQsUqfA2@vger.kernel.org X-Gm-Message-State: AOJu0YzDYLyLUB3TjIje+sIStk/u2UddbjWbM9A2lcZHGXcJZT+EdbnU u3W7juqBFn5g50SdsK0MJyUpmXYYTk1/MJ2HZm/AhtS0rnKPBpY0vfpmLJ/dcWE= X-Google-Smtp-Source: AGHT+IF3kesAXyhMwmNSL4o1EgSlt461F7qCTFbPjzkwgRZmy+poFqq9hqnI7K0qPneA/ge4SdrcfQ== X-Received: by 2002:a05:600c:5122:b0:42c:b63d:df3 with SMTP id 5b1f17b1804b1-4311ddff73dmr10861545e9.0.1728652183050; Fri, 11 Oct 2024 06:09:43 -0700 (PDT) Received: from [127.0.1.1] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431182ff6d3sm41621835e9.12.2024.10.11.06.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:41 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:16 +0200 Subject: [PATCH 08/10] remoteproc: qcom_q6v5_pas: Simplify with dev_err_probe() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241011-remote-proc-dev-err-probe-v1-8-5abb4fc61eca@linaro.org> References: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> In-Reply-To: <20241011-remote-proc-dev-err-probe-v1-0-5abb4fc61eca@linaro.org> To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1429; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=J4xZfv0aBPmZUKd/vkSpTrvNwZXicEmiz2DyP7s4fn8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOF8kFMiQpFUeuGBhxFHjTWsv5edpTYSPeAT Jb/y/ueQH2JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjhQAKCRDBN2bmhouD 15OSD/4m4QvmU19MrdHhDDZUabGwCw76kND3nw6IgY+o+BDPxNPHPtRXSlT7ttqiBbG1qnIHz0X QkzTH9R05BIdwteqKJ25YsVy7xpDSyLFdcFTAQ+zwLjD/eamsazhAnhtVHIZRNU61jJFuC9iaUj z9B1j9QMtn+xlzeGmE5lRIosQ3uJNw5B2uTq+c1SX8Va6YvyU2W0Xy94zUJzR74iraDzD8GxLvD td5u+9TBnov4zOeaqG9eb1A7ijiw2p3Z0WMdWBEnlbga6MfB+uqLlSLu6I4lq3YESAcSIrfDny6 sNVS4pAOZ39ozMZtIULoDcT/7oXHlON/dVFrkQgyPnee5w+K7L/tsBG9mi00YVqjrpcUzdqTMI8 aCDKtJUPJzSvAgzNJr9UoAk4iC5fw8D4fpDEKKU3/1hNqYsDWaqrl8O1tX/4kfFNK81IRp/6nav QIqQOhriIPbdy+KpO6ybA4L16WYyCVrs6Ixl1AXL1+HycPDn/nueW+qFz2UJ57g7zFmBcEfbZ1e DvWd92+FvvmEJIzI57FGwbOFqdlZ/RTCszUCUC+CCfxxuVSvjrLYC6wMzmDly1U1mRtsbYH/5qS 7b5CCT6jw3Sd52F2JYSOgcw4cNipm8REUbezWrLf92ngSfCOp6Kfms9R/o1cb6loPG6SLP2eg94 K6NTgztZXRuGmKQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use dev_err_probe() to make error and defer code handling simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/qcom_q6v5_pas.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index ef82835e98a4efd4bc603cff604d531a51fe9f9c..806b3baa297ea1053dde3343fd86cffbc05b8461 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -453,24 +453,16 @@ static const struct rproc_ops adsp_minidump_ops = { static int adsp_init_clock(struct qcom_adsp *adsp) { - int ret; - adsp->xo = devm_clk_get(adsp->dev, "xo"); - if (IS_ERR(adsp->xo)) { - ret = PTR_ERR(adsp->xo); - if (ret != -EPROBE_DEFER) - dev_err(adsp->dev, "failed to get xo clock"); - return ret; - } + if (IS_ERR(adsp->xo)) + return dev_err_probe(adsp->dev, PTR_ERR(adsp->xo), + "failed to get xo clock"); + adsp->aggre2_clk = devm_clk_get_optional(adsp->dev, "aggre2"); - if (IS_ERR(adsp->aggre2_clk)) { - ret = PTR_ERR(adsp->aggre2_clk); - if (ret != -EPROBE_DEFER) - dev_err(adsp->dev, - "failed to get aggre2 clock"); - return ret; - } + if (IS_ERR(adsp->aggre2_clk)) + return dev_err_probe(adsp->dev, PTR_ERR(adsp->aggre2_clk), + "failed to get aggre2 clock"); return 0; }