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: 13832529 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:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13832530 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 7708A2185BA for ; Fri, 11 Oct 2024 13:09:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652177; cv=none; b=EhP2ojwOH0dwsJL3YNkpSrbOEzUZWY0LneGuQ7GtBKpJIjWf5n1c/fA+n0/+tLAiA6njV3iRETziu7duKy4/Uolj+Qge6QE+KNeUjhu02MvTMq7AkBLaxGuyeYSLL5Ih8Dl/JnDXcnJOyW+/z76XqlojMsdNPEdus+wEOIZ2x3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652177; c=relaxed/simple; bh=gSXieckynan1ggvVnlG+inZiqvoY429i7fWJbf6BPSs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MKQLeHFCBTfZfhGrgoVkQ4hz1G/e8jpEsPP4UR+py9hphu3P8GYp1+IC7TrynEDubVeLoPATl+XA1Oh56Q99hPqeG2QIjwSbfNfKWa4iHQE70cUh0IxyfQZQPILbHfpgsMz3CSvTGQbXA2r7+K8yIeRpbOekJWvMOrta6YgGpFY= 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=KfgT8uiC; arc=none smtp.client-ip=209.85.128.41 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="KfgT8uiC" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4304ea60a58so2270165e9.1 for ; Fri, 11 Oct 2024 06:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652173; x=1729256973; 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=pKuBlnx6g3hljoBRvOf9HGy5tVw7a+mfxQ6RfkELrCo=; b=KfgT8uiCOEZrJE+lLBS+uXbdev6xs+JaIH80Mvw250c/9q8vivhI+8wQb7drdwUz0j hKSgstGPooddEzALHtZs4f5QeYXHHllbM1qrJa4v1PiGIA1MwHv94Cisx231G5iez1Fn t+qVPqmicOF2zhVLc/aQHT8qZUQAAVqgJSxAvnV1nDJ/HkFPyzJM8ybfU4sw3/X3uhaI MdELY14F74DHz+lJzPLMJ5WKSnC36XyZ9CpkWTUEkLEXJ3HoaLLNnszkYiq6h77sPhIT sFq6hH6Mc5SLEuxuW2EdpWfG1sidw7dcee8udgkSQPPpY4XipeEHoMOy+2ComlnO0bNQ fo3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652173; x=1729256973; 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=pKuBlnx6g3hljoBRvOf9HGy5tVw7a+mfxQ6RfkELrCo=; b=HOLOsQl1YpkgFWejsMNXowjn84WJdh0YB6j+9AD/29QZeR2kZSD0SWy7NtOuhRwAI3 dO8GDIYsoXl1neOWBKVjsIEsJpeAv9AKpZYSKVDONJz/ZcjZg9scGHf+OzVBW7mo62Xj 7cDPqfd2B3hTsvF3UlpKU1wtdoYInAss4zn0PMOYAQ7Owge3GWG0noo4oe6GdwCP4UrC FJgGl0TAUqoEq6LnAJHYWo9JbJHSyB39N5yywqyQVthRaVWno6LbX/2pec0+26N3Y0x9 LfCYpc+cN3paRNfrRfxZppWh5qHY83OKaAGzOOdf5vPAbYcDN+rJDVlgPgOrtsCrmHTZ mIfA== X-Forwarded-Encrypted: i=1; AJvYcCVvUDnynnadk3b5mZ4O34MSIjf5vntBbJfgqayQujG2CRzxtd5icqMK6Nmno3Yf2Wr2m4fA1TQ2XL3ScGKI@vger.kernel.org X-Gm-Message-State: AOJu0Yx5nzQnATHvR1jG5s75ak3BjixmydO4txI732jdK8DlIqp5TPcq z2dQWnlU8+1Q8nHWCBxigKjttW572o5lyQe8K8Jd2nYqBtIBBnhDLRuwTdQld6M= X-Google-Smtp-Source: AGHT+IGRkv8Jxp7w+8vtYLwBf0YkF4LDatGqUzWO19liXPl7ZpkzADwjozl4YjhJltfWQBGnAj/NEg== X-Received: by 2002:a05:600c:4509:b0:42c:aeee:e604 with SMTP id 5b1f17b1804b1-4311df5920cmr9955705e9.8.1728652172857; Fri, 11 Oct 2024 06:09:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:32 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:10 +0200 Subject: [PATCH 02/10] remoteproc: da8xx: 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-2-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=1862; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=gSXieckynan1ggvVnlG+inZiqvoY429i7fWJbf6BPSs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSN/ZevX3FY+fvEb7VdFdqC/CD35L0PTBwrDt CHc6yHUhHKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjfwAKCRDBN2bmhouD 14jZD/43rLFf0vRWeBRs86Npyw2pvEfM6EsVRyAJzhDYaKaJaaUQbe45yNjPKuPvuMEgf/H9e0Q JdfI2+zfCiWLHi1wesopOJ9AfTTb3+NvrVeGjpOiNoi8hylPrDSV4S7BGXhqvq/9B7m6BbU6Wum OCJ8ihXzcQOY9uOXna2ZgTtaf8TDhvLHh/MEX/nM+bsrXsQfujKi1BDIkhEibEmM8QRkm6+e6Qg 7j7jAKkTIQJj3w6lXjJYI3iGZvCsi1K+w2EfH3TWgxh6ZeAmPOZPqGw3fkRUiWVTzg0T+D8ROIG PYUzIs43ytNTisBmobcBMio3Ss5pgpvop9sF6usrnib6gc8RmgF0KTpTUOXjyEV6VEWkjMv9H+2 a5BhB7BfDSLsgMexX90eAazRObOE0rcAlID6nLXQCQCHM6tFwKlKnT7NkbW3LIwn5nEdQadKlnE oWZCFu8zWno30snXctQKm92Vh96kKMshG9dOzdj1Af5ms/GrcWkKHT5zEmgeImnkR3aL4wGG9Dp 3Uhednmif6edRQvfFajHxlhtrZJLesRVCmawJYHdOjV6+v+wex2tuNKbvz81k2O1l0cXebWNbUk mtwApbaLEmq0cVLO+B1oGTNwTambtlv1vFk0Av+ar4s2DYv7dnS/168rr7SmGDOhtG5jMipRzx3 m+c9C9R1k3zhLqg== 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/da8xx_remoteproc.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index f8121682ae9a2aeee560d7f012bc68d2cd53b5f7..7daaab8124e857e50201f16ab445115ea96c8abc 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -251,10 +251,8 @@ static int da8xx_rproc_probe(struct platform_device *pdev) return irq; irq_data = irq_get_irq_data(irq); - if (!irq_data) { - dev_err(dev, "irq_get_irq_data(%d): NULL\n", irq); - return -EINVAL; - } + if (!irq_data) + return dev_err_probe(dev, -EINVAL, "irq_get_irq_data(%d): NULL\n", irq); bootreg = devm_platform_ioremap_resource_byname(pdev, "host1cfg"); if (IS_ERR(bootreg)) @@ -269,21 +267,13 @@ static int da8xx_rproc_probe(struct platform_device *pdev) 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)) { - if (PTR_ERR(dsp_reset) != -EPROBE_DEFER) - dev_err(dev, "unable to get reset control: %ld\n", - PTR_ERR(dsp_reset)); - - return PTR_ERR(dsp_reset); - } + if (IS_ERR(dsp_reset)) + return dev_err_probe(dev, PTR_ERR(dsp_reset), "unable to get reset control\n"); if (dev->of_node) { ret = of_reserved_mem_device_init(dev); - if (ret) { - dev_err(dev, "device does not have specific CMA pool: %d\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "device does not have specific CMA pool\n"); } rproc = rproc_alloc(dev, "dsp", &da8xx_rproc_ops, da8xx_fw_name, 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: 13832531 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:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13832532 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 DB55121948C for ; Fri, 11 Oct 2024 13:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652178; cv=none; b=s7PBksgS8XxeelsMxaSbCM7UDh8u669KceKnzTAcSYraEri6I+MltF29+JrVMZVE2PY4mlRwJhq0akCmI0hFJyyo2iI2AveeVCBzuCxX4QPmNB6ZIarHFVUybELUZ5D3dURJKyzZBatV7cVLKPag3/ZC+9rlExMGxJDpKewFug8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652178; c=relaxed/simple; bh=LOjFy6nhC3aizwmwdmZxS8fZ5JcV0IBn7h8Abb/dF2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K+uEeacnNoWWt1kTNCpfqcZpj173Ezg/x8AYLZq2wiz/jvIwepWIvryF/UGTWS9QeKTyKtj3X5JtgcIqJbqZBcdbB6uK86cpqpem8WkCN85whevGPRC5tEzdKaqzEpiJHiGevOj2x8N4b/73fYXBDaBYr7VFDMVPBlNEBXb/Qoc= 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=xh+xKkhe; arc=none smtp.client-ip=209.85.128.52 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="xh+xKkhe" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-430549e65a4so2842575e9.0 for ; Fri, 11 Oct 2024 06:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652175; x=1729256975; 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=4tqipEDcglLmH5x1uziIV6m/c0LA+zbIAt3VXf+24i8=; b=xh+xKkhexw9rX/x9T2adXgB8hLZ350/W+/elHVF2FQDF1B6sXvkbEnZS5t0vLHI8AU 5lfYd8aFJY7RQuu6+pHv037uLYbqShingfDs++R73E6z3zceCyZAPtDXGic18ufG/vA5 1WoPmkUvLaoMSpyTwtHUoP2M89nwrFNFqJlIDlcI8uWizBLXKA/IDNs6vdlNRPkQyjHT uoUL3V9en7RxPiar9YbTyPbrOdfIqXKoIT+mCowxkwPGGkYyLgh+V7akft7Z4kiPqRW/ ymb3DLiJIZOuuYW6ZLo2t9ctX/A5zIjgAGdKaOWlO8ZZewr3lDIyXlvhDjTlULbsFwKQ j0hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652175; x=1729256975; 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=4tqipEDcglLmH5x1uziIV6m/c0LA+zbIAt3VXf+24i8=; b=JLUXNtmga8UMlrk+udqhiI4uBeeMHJkV9YIbl9A+ajbfalhBz/Gqr1nLTjl9jCPOwR muUC42MdyQgSQOR23P8uvNGj0swUDRLCQguMzSbB4Dekj6cChxAO3V0dleBkvoqEWqak 2IuAKa5TrwHE+EX0tWR4Hp6k1LagnHWCnh2ECrXR0vgN6AxQmoBF5RL4gmKMHdY+YPl9 nS4muTiO8VQmLNPSH61IpcNziipciXKnAtxAExIhgAo4xcPDRt7C63mq/DYfq7G8sSf1 iFGG4PVNAYC2p/t4kQviTJjXJI2H17YK5AtKppccWX2WoarMWjzzBDkPfhQFXIvlitdF VXaA== X-Forwarded-Encrypted: i=1; AJvYcCXb08gvZ5HdWRrEEN66O+YxbqNH4TYRvu9yZ9xy8nxUmuZqO+nXVfML9o8lJaQ0IJi3Pka31jdPumd3nMWF@vger.kernel.org X-Gm-Message-State: AOJu0Yyq/3itRfjJZEUf5L3RlYIeoqEXbJWmjoPxGUvkVya0tu9+EolR m1OTE1iHLiNHZwchd32U/dAasoeDoqf7YJkTogrhhz/mg96h9hYfpuI7T2YvalQ= X-Google-Smtp-Source: AGHT+IFKtxHJuxqrekyPdhVBMnAlWiWOkLEWdXtd2C/g5nqBPrGrF0mq3N0p82Jf8eiRmrLVWZMY0g== X-Received: by 2002:a05:600c:4e8e:b0:42c:b172:8c53 with SMTP id 5b1f17b1804b1-4311df39dbemr10197155e9.5.1728652175321; Fri, 11 Oct 2024 06:09:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:34 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:12 +0200 Subject: [PATCH 04/10] remoteproc: ti_k3_r5: Simplify with scoped for each OF child loop 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-4-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=1414; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=LOjFy6nhC3aizwmwdmZxS8fZ5JcV0IBn7h8Abb/dF2Y=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOB0CGEefde0iTMWB7udlQSwZInx30X4Kvb1 xaci8OKPlOJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjgQAKCRDBN2bmhouD 14QfD/96TWKrcYSPmRKB4BTPF1jzofGRKzn6PAWJ2hGNnp6Yz5u1wCttzo2HZ12TATG4ftPErMV iKjQJ0aMt6Mn0TgPQziNxsgA1r01+69huM34pYvZe9jY5ceYXDDujOCHA5o/DQQdplSP6tdVmSP YmIsVwjEyw7mtp3A60wd1+0nqejGGvZafrhTblMa9I8KpJh17WegAe0VQoZnMY5Q2SrOeX2rrfa 6BqhFws9hH59dYdY4COjIMMAaEKJ41wGj+MEfPAKdSdJxbedBHd336X26BY3RG6S2gSCB4GmdQm fT9uQVcn1QV7iqsAlZSYAECU87baYp5fhdsNX9EBxCVa2I8K+60u9YHYG7MbfxvZzLpACYe0SI4 1EO2O12cZIoezt0X0GDusygBetTWmoJwHZWX/UseUzBeBYC8PmfOBeax+fu6duvgiqYx3pvOVj2 Ow9tQgFulPnb7mKpYHJK9TsBCy9P6Rx3sbfysAOP6uBQ4W17OyBITcyCOmkYVA5Q7EPgtU+cFQ0 oZNZPTvmFK5tbCEsoExuIjIjZDsyGQ4vaZwBnAY7UfymJZcc1y0ZKJj5E/YVbHKlcVEt1MYlRSS fJwgqFenhw5qe/zLo78bv8rI3epakm3/Aice2YPdffHpbZ/3ejVZ7nFdrX4a74G6cVrlSADi5MP +45R/x9dXwBY+Lw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 5a2e0464e1b81e3d4571a466643f08a53ebefc0d..2f996a962f55755347e599551f8b7785b986d0dd 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -1650,16 +1650,14 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev_of_node(dev); struct platform_device *cpdev; - struct device_node *child; struct k3_r5_core *core; int ret; - for_each_available_child_of_node(np, child) { + for_each_available_child_of_node_scoped(np, child) { cpdev = of_find_device_by_node(child); if (!cpdev) { ret = -ENODEV; dev_err(dev, "could not get R5 core platform device\n"); - of_node_put(child); goto fail; } @@ -1668,7 +1666,6 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev) dev_err(dev, "k3_r5_core_of_init failed, ret = %d\n", ret); put_device(&cpdev->dev); - of_node_put(child); goto fail; } 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: 13832533 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 Reviewed-by: Dmitry Baryshkov --- 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:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13832534 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 78911219CB2 for ; Fri, 11 Oct 2024 13:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652182; cv=none; b=iGVtMc9mH1OAOa9WqK77dkWVCq5VxgoQ+v+CzDveqaFWExF7thkyWAKc1p+nRYJwB3Q0If8RP0fTqD3VAEsbPLaDxZf/wOlNMh96WeSdGz7qmrO3zoO4TNqViTdUFuJLZHeQtKjT2FBlLKhmgMEeWRYQzZcat6xZDly4ztKrkk0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652182; c=relaxed/simple; bh=bvaks1hkBdB6mLkHtBE9WICW75Nlrwxy9QIEZHf5SV4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TUib0C6DendRPYbwRYa4N+YSdoRKIDYgqPQbE3bBE9yz10ypYOOTuEJntfiKQASAnKalJ8srB/bEX2/Sal/kOC6dWBAbquOT4ZjGbP4x5ANyKJkhA8o1zGqoRqqkRzzB1+SkUzTQord6WxNjYa2BOTvXi8o4kTImwurmrJ4XTwY= 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=QP26Lct/; arc=none smtp.client-ip=209.85.128.45 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="QP26Lct/" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43117fd9afeso3044445e9.2 for ; Fri, 11 Oct 2024 06:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652179; x=1729256979; 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=Olg8vobPLxKKVdM2AmGN1izI2HRaSwEbsq5chGiY2mE=; b=QP26Lct/78CVddHfVjdz55twkuFSGCOLGYJPOQj79HOkW4TIXTan3bejj014MFzKO9 s/ub+4pAUzTBGqDK+kH4k4eZpgLGWr8FbC7At7N3Qa4DUwMvLDYQqc8prmYS182Bf+SC WOeV06sICe5rEAO9B1E4gOGcDeeuO5dyoWyjGndNyUEGEQJ9rbXtArbRBEZheVrO7IeI kNm0MQUj2EUoDGjFZOUFP0I+Vc+qKCIyqmVHI0FHiIOgDXqyHE9D/EoSC+26q9CAtU+T w0RRoZuk5rm6WcYPfa1ZkepoXfRE66nVjVQLhZ9CmavN3Z2KlV4t6gQ/cKWzS9ws56NC qlcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652179; x=1729256979; 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=Olg8vobPLxKKVdM2AmGN1izI2HRaSwEbsq5chGiY2mE=; b=jsPodUIeZl2E8G2HI2wIzuQqr5kLPIzeutwpDcTTEa7eNS/MS3XaJUt9Z0fJoyeDEW 9iN1EeZzd3QmtoQJ8pCUjWrl6+a9J2TJuWridh1lVTg8ayultt37xllVzqXjFdRpisXw yEzsA9uyFNRpwJPfLQtXdRG9+pwHYPzNoNR2MuYnMexgYytp//rsTCXp9/dkGMrUUTJm RgJRR3nBIV9Xw9vsOB2Jx6sJnc8R0cK8HC+OkRiMEHTuE4gJPi9fViokW5HD7KsXTosd foA614JKJGE5jBXt1yr4zFyBGMgMsYPsGrmao8Xa/QzjChalrgasIa7zWsAEf1m8xgCH d6KA== X-Forwarded-Encrypted: i=1; AJvYcCVu79yoGneoVBuFpuifN2yqZH7Es2HqNZIRjA7jalrCRxQssg7k8AixR3lnhyOLcOPhZVVSyHLLK6AXLrzz@vger.kernel.org X-Gm-Message-State: AOJu0YyhAAmx0CYsuVRRSWoO5Hi7Iv+1lvucK8gd8Ra0EKAnKVBcCIoN Tvi07acfAOAvFLpUsCYe7BgLRjKq5ARw2MdbEUxm7YKmbjd2/WCcf3dAaPb4o6gL99rj+3X4KYx V X-Google-Smtp-Source: AGHT+IFpNFWEOyFUWKDSkiNlm3PuRHh6l2nekkNPS86zLVNOkzKgF0XXWQYiHg7H/r+Qxem8WLu3kQ== X-Received: by 2002:a05:600c:1c18:b0:42c:ba61:d20b with SMTP id 5b1f17b1804b1-4311ded5e0emr9831245e9.3.1728652178690; Fri, 11 Oct 2024 06:09:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:38 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:14 +0200 Subject: [PATCH 06/10] remoteproc: qcom_q6v5_mss: 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-6-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=1891; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=bvaks1hkBdB6mLkHtBE9WICW75Nlrwxy9QIEZHf5SV4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSODbabTLS0pgHoToJ7VcKLDStZd9nrPVUHY0 riYkvXG1AGJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjgwAKCRDBN2bmhouD 13b3D/9DytQwg/ro7GHg8SA//whmufixWNVrMMzZ5TDG8MQbnVYgfVahpwYfOm2aZB003Kxg7jw lQ1qU3jncUebqCAVSwgdyarXu60+mvJMPfKSTEuPYKtFdDPiZGkCH2ORCAsrumq9B/Knybf4a4l x6d1C7l/Zy6c4q3t3WY/RgEhgKNaVGoUi0WAWdxDe3hSGEvwDOL9dzC04ohPxq4ftd6hl3wWphy vL1I8OagpVsQQLe0af18gN9rKEeMQgeFdlHGTLSR/utNw8Iz256u6LrVPRqL/NpLJZOx/D9yyo/ IEcvLvmIsLXsdxjZZtNscc/4JE0vBdEXbkkSDR2GKkx4+4OCYud5oOxyMhdWe/moo2HohhSePSK srcgoEmoOuzT2Fvl5FxQLXGNXCDitLy9qghJVeK/ONv9IFCFJJU2KC9374TPi+srKsQIwRi3lqN 6JjGR00TdhfumQ7Kb6GF9o7EQ1qgb76vV+DCYdRr8QivQxm4g4ePzCp5AR48yZxJcotPqXP5+Kx l2xZJa+ur5gb7XYstfUMyMe5mp2B2khe4EbRYaM0q+Ns7NZiSfngSyiXZa5nvb0qRJi8ENDymss bsQIK2+dSNu9LsYbtLeq3RWYN/JVsODNNmhdfCq4qxEyJ5Cmb4ZVQfFzn7tIUihJ0Em8HqqrBFz o/gWveKt1t+v7IA== 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 Reviewed-by: Dmitry Baryshkov --- drivers/remoteproc/qcom_q6v5_mss.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 2a42215ce8e07b25cb45e708aa62f9ebe83bb88c..92212892a53ea4843da62642c39413c33b4c962a 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -261,7 +261,6 @@ enum { static int q6v5_regulator_init(struct device *dev, struct reg_info *regs, const struct qcom_mss_reg_res *reg_res) { - int rc; int i; if (!reg_res) @@ -269,13 +268,10 @@ static int q6v5_regulator_init(struct device *dev, struct reg_info *regs, for (i = 0; reg_res[i].supply; i++) { regs[i].reg = devm_regulator_get(dev, reg_res[i].supply); - if (IS_ERR(regs[i].reg)) { - rc = PTR_ERR(regs[i].reg); - if (rc != -EPROBE_DEFER) - dev_err(dev, "Failed to get %s\n regulator", - reg_res[i].supply); - return rc; - } + if (IS_ERR(regs[i].reg)) + return dev_err_probe(dev, PTR_ERR(regs[i].reg), + "Failed to get %s\n regulator", + reg_res[i].supply); regs[i].uV = reg_res[i].uV; regs[i].uA = reg_res[i].uA; @@ -1813,14 +1809,10 @@ static int q6v5_init_clocks(struct device *dev, struct clk **clks, for (i = 0; clk_names[i]; i++) { clks[i] = devm_clk_get(dev, clk_names[i]); - if (IS_ERR(clks[i])) { - int rc = PTR_ERR(clks[i]); - - if (rc != -EPROBE_DEFER) - dev_err(dev, "Failed to get %s clock\n", - clk_names[i]); - return rc; - } + if (IS_ERR(clks[i])) + return dev_err_probe(dev, PTR_ERR(clks[i]), + "Failed to get %s clock\n", + clk_names[i]); } return i; 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: 13832535 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 Reviewed-by: Dmitry Baryshkov --- 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: 13832537 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 Reviewed-by: Dmitry Baryshkov --- 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; } From patchwork Fri Oct 11 13:09:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13832536 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 0D15421B43C for ; Fri, 11 Oct 2024 13:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652187; cv=none; b=aF8h5by/RdgTlyrxDYiSLkSUtlRZoO6FvYZ4piM/Ya9lqNIRQr+W2bKYraDMqiCFdUTZfw42HQT7BIx75IuJ97Cf/4fnA5xTYH3VpoPwxEtfca/+fMw3NeLctQeVhJc4KxZzMldT+F3aoIGfweJQnXcl0ZuHBlhHOCLyaYpBMsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652187; c=relaxed/simple; bh=aMcNBPeURPXIhNuMngoM0gRIWvppAMi+Wbo99mTH2bs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WORjBiiSQfouCkIDP1Ui3pIf1Y6WvMcUeL+Y76dwnkCl9sxTOQC5yGl6SZ6JuEszv02zwEyxv4e5TVafhUTplrTD9TPg60WWH3viVfGSlUM/yGnPXFWnAL33g5DPlILSZ1ckYMqrNLlup8RQM5W3cLX+z1ivDtHNn4xG6mv44jc= 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=nuzoGB4a; arc=none smtp.client-ip=209.85.221.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="nuzoGB4a" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d450de14fso148833f8f.2 for ; Fri, 11 Oct 2024 06:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652184; x=1729256984; 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=lrM6MfbqjGQogO7kaKSf9Rc0irvOSmDPvQniDSWlBW0=; b=nuzoGB4aDsFqvvkfC/zwdBaDexhLuS1lHH4fgZqkBoo/MiOde5GgQuQWNdQLAm9g+v Vc31Zg2hsoH3tyhEVa7ByEvlYvGfuob3Y2S4g06gux9q/RUU6NcCfSvMJEq519AB6s7C Ow59Q6yzFne4spI4P/11WE80Ewj9l9xVAn02GoC9byZg7KVIbfpur07c7udyDGYYHLo4 bkOWWtMyGhlAvhmGzRXZ2qY0OwXiPiMvYgHPLrLragCkN+X81F1nZ1jvbKlRAiTBpUho 8xmeU3/m1jzYl32B0oYhxmO1ncAazpZ0wv2dOR4HpxxkWiuCVptkhwxHUwR4HzeEYCiz yVzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652184; x=1729256984; 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=lrM6MfbqjGQogO7kaKSf9Rc0irvOSmDPvQniDSWlBW0=; b=oiK0U1y9Nfvd/CHg+xwFHEPjY97TvdcgyZjrl+v1piXjH74JW7T+3f4SvJwsZTmiIo WD64VR+78YkSfIYCmNtfw3I/IJsvt5q7faFhruNsRXAF4sjSjliIr+11Ft5+VN0RS7QS 0IzeFXfevgoQelIk/ZUAwY2wwkBfnVCVlSJUdk/s/0r9qyP4o/cH+Tn4sk4OvzBkbUGS 7cPC/F+6SKrcocyK4W95PEnHSxO4IT2Otp+C/F/k5RJTnHRapWPBklJ0PDxMlVD7VPcT wyF8LxNwL/kLm+vsKzGpclo4nUJt1K+aiZJwCtzVx2JnV1D8GA5hdZvNN5YIw0SLh/9u O21A== X-Forwarded-Encrypted: i=1; AJvYcCUdSGSvRUYwaNVcZhSlxUv4cUU4u83PAjQzKrwkA7WJOz7t21u4NCt5IO0zNCd2Zk//WNZd1pOoGI3aqHoM@vger.kernel.org X-Gm-Message-State: AOJu0Ywaap9HxNx89KVcmT0Vf0n2iayh1STixc/4FzvAhNUQ6ooGT07m dPxdLtlle3H+VNkTS3QwoNRt3IlpNfzNJuroSWV7fSWzDtgWm9G9UAcSHx+kYrY= X-Google-Smtp-Source: AGHT+IGLzh9qD7wpeSjGtp0Ds5swuxDDAZLcgxh47KTeFVzcHhpNLCZB9ujHVAwAoK2ct2UW/jc3Gw== X-Received: by 2002:a5d:6942:0:b0:37d:54d0:1f15 with SMTP id ffacd0b85a97d-37d552b2603mr742424f8f.7.1728652184313; Fri, 11 Oct 2024 06:09:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:43 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:17 +0200 Subject: [PATCH 09/10] remoteproc: qcom_q6v5_wcss: 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-9-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=4784; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=aMcNBPeURPXIhNuMngoM0gRIWvppAMi+Wbo99mTH2bs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOG9GyRPmqGm0cNl2il7G6aX1v4RHpRs9z45 1XqkKwxmSCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjhgAKCRDBN2bmhouD 1wTkD/9IxVIyRbJMy7WI1BiD2FudLyUctCTRvC13re08iv09i6WtfXEFj7X3R4O4IGVjadK+iiQ 03EsyuUpw29FtPnskFXRcSnLj2D+vilg3YHx64nZQyX8Z5lIWCeUncHYLGN2NGIyoPDVn5F/EeB hGFobyWZn5BKUpIRWjLMd+n3Of+RKN1cBoU/1uhsb2ONNWZsHFgOWlIhaoD/LOhFrvuEoNcptJm yqpcs+SkKgdxSFPKoLepNZw33fHt+jVx5D3Ifqtg/4FxLkUi4xjaiHO1dNQgWlQuiXU8AsWqBFE Jl7w4DzZQ7h01zfpj/HUjBMuMeT1FNBCm/7UlgTRxcQQfMRBY+FYAQJUuONfJLCisV+RHN7gJoe B8bl6hr3LeXaH9qg/M6ye2Svd5ORdTI5lZ5KRkO6trAce2qFWKt5mxsvH6F3u3Y7IS9xbugUHmt 5Fxuic7OVPvrPjzVEOyT6rlHGeCNQkt9DIhcPX07iv90B9wJJR+QQ+HVB+x1Au9tLP9iR2tgsdf d/UoRb3VCULVD4MFpAewCTBzrn5dumsEqmfZoHgwtjpTJ2N9utGN48x++M7J4LIESj0/tLbcYg0 8QZNlnx7/9keRRcw+bbjivQ3/zkC581kAj033mjnXmrfANvdN+TqD0ERpLZicVmMPr+ZxSTeFA+ +SEY6GyqZOPy2tw== 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 Reviewed-by: Dmitry Baryshkov --- drivers/remoteproc/qcom_q6v5_wcss.c | 92 ++++++++++++------------------------- 1 file changed, 30 insertions(+), 62 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c index e913dabae99245da60404461240ebeaebded67eb..8161575d821c4533646223a1d967172e1cdee9c1 100644 --- a/drivers/remoteproc/qcom_q6v5_wcss.c +++ b/drivers/remoteproc/qcom_q6v5_wcss.c @@ -902,90 +902,58 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss) static int q6v5_wcss_init_clock(struct q6v5_wcss *wcss) { - int ret; - wcss->xo = devm_clk_get(wcss->dev, "xo"); - if (IS_ERR(wcss->xo)) { - ret = PTR_ERR(wcss->xo); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get xo clock"); - return ret; - } + if (IS_ERR(wcss->xo)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->xo), + "failed to get xo clock"); wcss->gcc_abhs_cbcr = devm_clk_get(wcss->dev, "gcc_abhs_cbcr"); - if (IS_ERR(wcss->gcc_abhs_cbcr)) { - ret = PTR_ERR(wcss->gcc_abhs_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get gcc abhs clock"); - return ret; - } + if (IS_ERR(wcss->gcc_abhs_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->gcc_abhs_cbcr), + "failed to get gcc abhs clock"); wcss->gcc_axim_cbcr = devm_clk_get(wcss->dev, "gcc_axim_cbcr"); - if (IS_ERR(wcss->gcc_axim_cbcr)) { - ret = PTR_ERR(wcss->gcc_axim_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get gcc axim clock\n"); - return ret; - } + if (IS_ERR(wcss->gcc_axim_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->gcc_axim_cbcr), + "failed to get gcc axim clock\n"); wcss->ahbfabric_cbcr_clk = devm_clk_get(wcss->dev, "lcc_ahbfabric_cbc"); - if (IS_ERR(wcss->ahbfabric_cbcr_clk)) { - ret = PTR_ERR(wcss->ahbfabric_cbcr_clk); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get ahbfabric clock\n"); - return ret; - } + if (IS_ERR(wcss->ahbfabric_cbcr_clk)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->ahbfabric_cbcr_clk), + "failed to get ahbfabric clock\n"); wcss->lcc_csr_cbcr = devm_clk_get(wcss->dev, "tcsr_lcc_cbc"); - if (IS_ERR(wcss->lcc_csr_cbcr)) { - ret = PTR_ERR(wcss->lcc_csr_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get csr cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->lcc_csr_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->lcc_csr_cbcr), + "failed to get csr cbcr clk\n"); wcss->ahbs_cbcr = devm_clk_get(wcss->dev, "lcc_abhs_cbc"); - if (IS_ERR(wcss->ahbs_cbcr)) { - ret = PTR_ERR(wcss->ahbs_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get ahbs_cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->ahbs_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->ahbs_cbcr), + "failed to get ahbs_cbcr clk\n"); wcss->tcm_slave_cbcr = devm_clk_get(wcss->dev, "lcc_tcm_slave_cbc"); - if (IS_ERR(wcss->tcm_slave_cbcr)) { - ret = PTR_ERR(wcss->tcm_slave_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get tcm cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->tcm_slave_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->tcm_slave_cbcr), + "failed to get tcm cbcr clk\n"); wcss->qdsp6ss_abhm_cbcr = devm_clk_get(wcss->dev, "lcc_abhm_cbc"); - if (IS_ERR(wcss->qdsp6ss_abhm_cbcr)) { - ret = PTR_ERR(wcss->qdsp6ss_abhm_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get abhm cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->qdsp6ss_abhm_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->qdsp6ss_abhm_cbcr), + "failed to get abhm cbcr clk\n"); wcss->qdsp6ss_axim_cbcr = devm_clk_get(wcss->dev, "lcc_axim_cbc"); - if (IS_ERR(wcss->qdsp6ss_axim_cbcr)) { - ret = PTR_ERR(wcss->qdsp6ss_axim_cbcr); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get axim cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->qdsp6ss_axim_cbcr)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->qdsp6ss_axim_cbcr), + "failed to get axim cbcr clk\n"); wcss->lcc_bcr_sleep = devm_clk_get(wcss->dev, "lcc_bcr_sleep"); - if (IS_ERR(wcss->lcc_bcr_sleep)) { - ret = PTR_ERR(wcss->lcc_bcr_sleep); - if (ret != -EPROBE_DEFER) - dev_err(wcss->dev, "failed to get bcr cbcr clk\n"); - return ret; - } + if (IS_ERR(wcss->lcc_bcr_sleep)) + return dev_err_probe(wcss->dev, PTR_ERR(wcss->lcc_bcr_sleep), + "failed to get bcr cbcr clk\n"); return 0; } From patchwork Fri Oct 11 13:09:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13832538 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 0AA3A21B45A for ; Fri, 11 Oct 2024 13:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652189; cv=none; b=hNfi0DJ0V9ffunJgO+Jd2aeI6uAqOlJu44p4FMyqRKZr+Cd8n2CXptvnaHvnoHd8cFJ5hLYZWM6+v2LLnSyUDGoGO7obpqKfav0sF4iH3TiF7KytCZTqv2JlvLUEeyckeLAL7wdbEnZWUcxkM7muHTB4QocC8y++scCb+wE+6Zs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728652189; c=relaxed/simple; bh=aiK48nBymVvo/dH/OUWaei0T3BtvhFeLUjzn+aJU3M8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u4ERecqIdcuijyjRf86LjLZTe9WPyaZlizJmnhr0/EjGwe9Ed8erd6wEBrMZEJ5aP4LdGU0Lx7D4TRu1ou1HgKpzjBW+OtcvZ1wY8qI4QNT1KJQyCEQKTYsEFxvPlqHkgUOdq6d2chavQczrY9mEZvgN5pP9M1G8EN0OhFL2up4= 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=Z5ZMV0EB; arc=none smtp.client-ip=209.85.128.53 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="Z5ZMV0EB" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43117fd9afeso3044665e9.2 for ; Fri, 11 Oct 2024 06:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728652186; x=1729256986; 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=v31GXG69vMHk4ux07CakUHVd4DKmezn/8McUHHPc5yQ=; b=Z5ZMV0EBIC9p7mIVw5hMeXKtcyl5bjDW6ISujvli8bCjRIrkZ++6raSPG8Zt0qsJOj tAaPSqdbPA1ePjOjOQZgERpTiGzjhO12+xn914UugGW9PtN//En6a+I9FvM7AvYEaq1u TboutNC8vAZGKHzU+Vo5UQHQJqBDPOKrcqR/dcYyhadIrznIAktEkKOwqm2+8vzjm595 D59xeA6UsmTfCUZD9azo3iXkx22AqcBlXTQtZPeDGKf5TWOPSSr/skFYAN+IDwpAqfQ2 BwDee2QdaB0EJvGc4/3BrrN+Y//LBQoXZZChUQiucXmre1Y1ExvsTPIiOoO9VGVmN6jP xGEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728652186; x=1729256986; 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=v31GXG69vMHk4ux07CakUHVd4DKmezn/8McUHHPc5yQ=; b=pEQli4xOogvqxXLCq/A5KcqliRXDTnl52LOrsbh1wcrWfOd0fJr0KIvEYv5UtQzsoq nW5QT+Rw11OCCy7H5ye5ONAI8FKoELFK0S0NtNwMNpe2YggNaq1T7csauhgzpmwsMFrK M834COzBL7IWj45uZbK6C37kqE7vYe4kmA75TCYP+7HGP4rgwZdffns1bjgD2XQTxqm2 +pD03XMtEAT444lYJWTILE5fa185aUmet34cZO3SYJTuLqEGPGVCx65HL5Rv4yHSmJMX qwIkQ374wHd6KFImef0iayg829VlnrzccLG2414xxbEq4KAeNZiq0KZDwurLa9af0Gm8 /foA== X-Forwarded-Encrypted: i=1; AJvYcCW31fM3l8DuvB12Gz3frrSdSQlq9a89QuleKUF478X1NmGVlFWhr61k139Z4j40ZE+TDhGuscSqvx7VnzgX@vger.kernel.org X-Gm-Message-State: AOJu0YygtMTkogVJ0dzphRhOeeG0nhQgxraPWg/799TKEGRi/56iQOGe OI7hHjiYyalCnUyJskTJzFMDpSO22k16d8Lts5VqYdssSkbPpas/r78/qUdn5R4= X-Google-Smtp-Source: AGHT+IFJV0fBBqZyQIuuDztYZ99k87dRRpSQN2NCI/NjAAk0eHOZWEgeToj9dTo5YUpjSkp3esjnjA== X-Received: by 2002:a05:600c:358f:b0:42c:bfd6:9d1f with SMTP id 5b1f17b1804b1-4311debbe68mr9904785e9.1.1728652186408; Fri, 11 Oct 2024 06:09:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 06:09:44 -0700 (PDT) From: Krzysztof Kozlowski Date: Fri, 11 Oct 2024 15:09:18 +0200 Subject: [PATCH 10/10] remoteproc: qcom_wcnss_iris: 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-10-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=969; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=aiK48nBymVvo/dH/OUWaei0T3BtvhFeLUjzn+aJU3M8=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBnCSOHreCkDDMaYxg+FYD85uid+AJHsN2qlBqkX gfF0DvhUfCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZwkjhwAKCRDBN2bmhouD 18SCD/4xlZRL8UTPeW0P/qXuNj4U5/rZazAAwWCrbdb/JmJx1KmWWQapR5Ty9P3vU/UT9lKp+EK 392NKtcByXR8vDiJtXv96LJwZWZV9Hl0+IVfDbngWC/W+IJT/07rXU5lVjo9+JeO0T143yU6GQ6 J2C9HWbklt61TT4Yk9yEF4m966qdA3OZLhnbXOsL/1BU8ZKt6gqdbSwV2dajQp6MQ9xCb6YsMXr JnkOEIh2mqhUbd2gjgXCKFwtJi247kIizv5C7yaF/HExhnh4on/LjkfzMR4nititybGuPmRI0q7 stsvmdbiqAnzmLlLDt/LWjY64yVEBtmGl90G32RyB2XToY1U921JW6rGJUo0ZSjhL138H9zL0xm +Nf90Wl8qEWdKvCy07axRt9Te2u1gRZ/Aof2b5cmw1GzFeVap4yL+wT6lkq3oHeVQRs2/SSin6j KQF+eTk5md7RZp4WOoKZvWJwAKEidYQLPBxdLks0eYdLzT1AY6vVx9HlX/B56m06ABKg17IqN9w gww58cvK3B5ntVmtVD8wZqVyL/03PbElXM1MoV3usWZniqETegyqNmDyK+nHWMPJ4r3pZAB+LzM LUiWbq3YbWr/ksKP75Kzo1I1O8TBqQ3XjOUoYxTVuVg5NWnI7NSirK5xtSwuGPmWWAAgPx6q9Md TOPVThfw/iiltiw== 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 Reviewed-by: Dmitry Baryshkov --- drivers/remoteproc/qcom_wcnss_iris.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/qcom_wcnss_iris.c b/drivers/remoteproc/qcom_wcnss_iris.c index dd36fd077911afec942f553a55128258c10ba946..b989718776bdb5843bd48b2d724bf1c483725bf3 100644 --- a/drivers/remoteproc/qcom_wcnss_iris.c +++ b/drivers/remoteproc/qcom_wcnss_iris.c @@ -155,9 +155,8 @@ struct qcom_iris *qcom_iris_probe(struct device *parent, bool *use_48mhz_xo) iris->xo_clk = devm_clk_get(&iris->dev, "xo"); if (IS_ERR(iris->xo_clk)) { - ret = PTR_ERR(iris->xo_clk); - if (ret != -EPROBE_DEFER) - dev_err(&iris->dev, "failed to acquire xo clk\n"); + ret = dev_err_probe(&iris->dev, PTR_ERR(iris->xo_clk), + "failed to acquire xo clk\n"); goto err_device_del; }