From patchwork Mon Sep 9 12:29:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13796943 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5842B1B78E2 for ; Mon, 9 Sep 2024 12:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885791; cv=none; b=GoAzNJf7GjHiWCEKhG0FOFTI4EZlVQcDAmx+WlDJC63uTXOeUTixjMKoaXW1XGfW+n4zg5T7Tsev3uGgaHCH0iMNpJP3DukJidZLLn6ds7MbbZuX8+nXR3cGHEea/S2J2ymLxIciM/TFc3osPpM1hj1ZN6ZqJxNb3AzcgZBKf1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885791; c=relaxed/simple; bh=DSPvXa4o6tzcfmztvVACiB4N2tcf0aeUuANPON1DcxM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uO6rRI3P3uxnPn6C7qxFjy9UWIxidOtmHXOMvvUCUkRDznCXnbWNRV1QojQhKKBllaM2LgjrQDOx5pbkINE/JzAs9ERVmtNj6f3vPlEb4AoZqMGOgysFACij8K4hD45t/XGG6fpBSZfzOHyRxU81SXdZp1steMZjXAtI1dtF4NM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4X2RLl3lbjz2Dblt; Mon, 9 Sep 2024 20:42:39 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 622F21A0188; Mon, 9 Sep 2024 20:43:06 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 9 Sep 2024 20:43:05 +0800 From: Zhang Zekun To: , , , , , CC: , Subject: [PATCH 1/4] soc: qcom: rpmh-rsc: Simplify code with dev_err_probe() Date: Mon, 9 Sep 2024 20:29:18 +0800 Message-ID: <20240909122921.12627-2-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240909122921.12627-1-zhangzekun11@huawei.com> References: <20240909122921.12627-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun --- drivers/soc/qcom/rpmh-rsc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index de86009ecd91..cb82e887b51d 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -1045,12 +1045,9 @@ static int rpmh_rsc_probe(struct platform_device *pdev) * do. To avoid adding this check to our children we'll do it now. */ ret = cmd_db_ready(); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "Command DB not available (%d)\n", - ret); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Command DB not available\n"); drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); if (!drv) From patchwork Mon Sep 9 12:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13796946 Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86B121B78E8 for ; Mon, 9 Sep 2024 12:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885792; cv=none; b=Zuqai3CWEEnryyQRFZ/SWtBrTQRvD/Qd+LEAo5g35E9kUgPm/PmdRbgLfqSSm1idji/8oIKr+bN6NKS9W4EjPZL4dXGMsnW6b1JQux3OQFaIfKQiHdbW1UfIa1H7Yb5pU25QPNyFyqfTeyZhdNpNMlGPyKtg/nvMioSwV7ISddo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885792; c=relaxed/simple; bh=Dqp5ecNxZw5g63/smkaU9qFaQVRWAtKNcpXz2Ib8jSo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BILzR8t9gfAoWsLYmOUUk6JHNQOCPBrJwygwVm1GMRqdOufw/rNCS6RdeSdBxIR6RIlgUmE3vFGUt8gUTkVjsALsiZsOEKc715AO3QaB5pjo2jSTvuTu24hFaSc/MM/YuLE8mDPJSg39ABlUFykOToG1NaxlUmfdFsIOI0HbVMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4X2RMF3bP2z1xx4Z; Mon, 9 Sep 2024 20:43:05 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 1F47414022D; Mon, 9 Sep 2024 20:43:07 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 9 Sep 2024 20:43:06 +0800 From: Zhang Zekun To: , , , , , CC: , Subject: [PATCH 2/4] soc: aspeed: Simplify code with dev_err_probe() Date: Mon, 9 Sep 2024 20:29:19 +0800 Message-ID: <20240909122921.12627-3-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240909122921.12627-1-zhangzekun11@huawei.com> References: <20240909122921.12627-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun Reviewed-by: Andrew Jeffery --- drivers/soc/aspeed/aspeed-lpc-snoop.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c index 888b5840c015..33d9f8f2e662 100644 --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c @@ -293,12 +293,10 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) } lpc_snoop->clk = devm_clk_get(dev, NULL); - if (IS_ERR(lpc_snoop->clk)) { - rc = PTR_ERR(lpc_snoop->clk); - if (rc != -EPROBE_DEFER) - dev_err(dev, "couldn't get clock\n"); - return rc; - } + if (IS_ERR(lpc_snoop->clk)) + return dev_err_probe(dev, PTR_ERR(lpc_snoop->clk), + "couldn't get clock\n"); + rc = clk_prepare_enable(lpc_snoop->clk); if (rc) { dev_err(dev, "couldn't enable clock\n"); From patchwork Mon Sep 9 12:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13796944 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0D481B5ECA for ; Mon, 9 Sep 2024 12:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885791; cv=none; b=ICJDLz+fIBRD6/J1HMtNSNvBIV2Aw7UJJjOsEhcKouEN+jBzJldQrmikrQ21E5eowCQoDpTLrBOOjpO1quUGVwYh0tg598OdF4GI4gZrMOJRKDp5UfvO861R7pIADa2A1d7BItr6yEUJq3AjWV0yzTyatZdNRxEnN+ruaKBCOu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885791; c=relaxed/simple; bh=Uv8gCSL/+hsZUrapvZE4Sr1pB/H4WqPGyHNkN4wNF+w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lx1rvs/Zn/2w2bjriuudwsBYHhbkM+ZgphoK7RA/gck/rxpibsH+lt1ubwljde3ELQYux4gdPFNxS0Xp3GwWQcYx81UY73Oa9Q3DtGcGL+aRHrjJM0c5volow8BtIOpn49LL2RmdoMyk8GkITCD/mSC9txE791pzLHu9C287beo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4X2RLn14bNz1j7Y4; Mon, 9 Sep 2024 20:42:41 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id CD52E140134; Mon, 9 Sep 2024 20:43:07 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 9 Sep 2024 20:43:06 +0800 From: Zhang Zekun To: , , , , , CC: , Subject: [PATCH 3/4] soc: qcom: smem: Simplify code with dev_err_probe() Date: Mon, 9 Sep 2024 20:29:20 +0800 Message-ID: <20240909122921.12627-4-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240909122921.12627-1-zhangzekun11@huawei.com> References: <20240909122921.12627-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun --- drivers/soc/qcom/smem.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c index e4411771f482..a8ab99c9c996 100644 --- a/drivers/soc/qcom/smem.c +++ b/drivers/soc/qcom/smem.c @@ -1180,11 +1180,9 @@ static int qcom_smem_probe(struct platform_device *pdev) } hwlock_id = of_hwspin_lock_get_id(pdev->dev.of_node, 0); - if (hwlock_id < 0) { - if (hwlock_id != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to retrieve hwlock\n"); - return hwlock_id; - } + if (hwlock_id < 0) + return dev_err_probe(&pdev->dev, hwlock_id, + "failed to retrieve hwlock\n"); smem->hwlock = hwspin_lock_request_specific(hwlock_id); if (!smem->hwlock) From patchwork Mon Sep 9 12:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "zhangzekun (A)" X-Patchwork-Id: 13796945 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E8A61B7901 for ; Mon, 9 Sep 2024 12:43:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885792; cv=none; b=ddFEq8lu8XNDELPH3Xs5CM4PJcXlebWx/JhkGjfg0TjQnu1aKMOivkYS9K5SfeRKe9iJM95A4yIEkx5JVS+oeirTr/ob1+cAvuWB+XVv/wiQVYqcqykoI2daK/FUPi2gWiAFcDfn0A84sEsJYjVbsgb9j52wmWASZuDmkcFkxjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725885792; c=relaxed/simple; bh=becaD6o/hyjDE95IqcfZ70JhkM459gnX8U9qnW8KvKM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DbwO2NwMvB+EmZy5bQ1fYMy47I1ecZQxxc+lhxvs7qFZfC6aKuY9APFQYDwICU0ReeqOPlFHllramstx8B9NdX0LmwMLwW840NB7fwYIa1TzV6HZ9riO1bx09SURIsuaeaSHZHIUBcIKn4sI59lecuAwbAkiPmPxQ12w+ExYXPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4X2RLn6Hs0z1j8Ly; Mon, 9 Sep 2024 20:42:41 +0800 (CST) Received: from kwepemf500003.china.huawei.com (unknown [7.202.181.241]) by mail.maildlp.com (Postfix) with ESMTPS id 8B53A18002B; Mon, 9 Sep 2024 20:43:08 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemf500003.china.huawei.com (7.202.181.241) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 9 Sep 2024 20:43:07 +0800 From: Zhang Zekun To: , , , , , CC: , Subject: [PATCH 4/4] soc: qcom: smp2p: Simplify code with dev_err_probe() Date: Mon, 9 Sep 2024 20:29:21 +0800 Message-ID: <20240909122921.12627-5-zhangzekun11@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240909122921.12627-1-zhangzekun11@huawei.com> References: <20240909122921.12627-1-zhangzekun11@huawei.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemf500003.china.huawei.com (7.202.181.241) Use dev_err_probe() directly in the driver probe phase, and we don't need to judge if the error code is not equal to -EPROBE_DEFER. This can simplify the code a bit. Signed-off-by: Zhang Zekun --- drivers/soc/qcom/smp2p.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c index cefcbd61c628..2731449e2201 100644 --- a/drivers/soc/qcom/smp2p.c +++ b/drivers/soc/qcom/smp2p.c @@ -467,12 +467,9 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p) int ret; ret = qcom_smem_alloc(pid, smem_id, sizeof(*out)); - if (ret < 0 && ret != -EEXIST) { - if (ret != -EPROBE_DEFER) - dev_err(smp2p->dev, - "unable to allocate local smp2p item\n"); - return ret; - } + if (ret < 0 && ret != -EEXIST) + return dev_err_probe(smp2p->dev, ret, + "unable to allocate local smp2p item\n"); out = qcom_smem_get(pid, smem_id, NULL); if (IS_ERR(out)) {