From patchwork Fri Aug 30 11:04:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shen Lichuan X-Patchwork-Id: 13784952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9793CCA0FE0 for ; Fri, 30 Aug 2024 11:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=hUwiPDcuYn9Hd5t30PyjpANSQ6ebHEF2FYkW3T6IzPQ=; b=RzEd/gN5OyUc+MtjjaX0ZB1B/5 iY5tr91aU4iwRqHKGB6TAiYnoSdLLAEWshxMvxCJo/ny0btt3YQTS9s/EXYfeUwTu/XMFfvtAe8R/ rfbtOh0SVcknkq+AV8DJtrB6jRcPUnnpW3UaktozQYTRORy7A6koEud9aXX+D1Tp5Ea1w7hjbOu4+ S+nNuE+z9GqV6LmR2BRAmFBqMAB7YQseUOg6KvEE7L88uc780f2hYMsfEeMogy4iT6vWwST4nwqCp 1PC9VKLwaEk4YyYKw8TW/dL5NqTEJOEjgRiddnQwo9kMwbwh8DH+tAEE6Yu8EMSzP8jgr2ABt+yaG aCOj4Qpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjzVF-00000005ykt-098U; Fri, 30 Aug 2024 11:09:17 +0000 Received: from mail-tyzapc01on20625.outbound.protection.outlook.com ([2a01:111:f403:2011::625] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjzQm-00000005xHR-2fqN; Fri, 30 Aug 2024 11:04:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fxAfsvhlUcuR7YfMuXEDq+MDy7UO1//6r8EhDiv1ZCnLrYVEF7PddkzZox5Gifx+LAkhB3dAI5m4Exas2QwHqUtv+IaNlse+7cGayYsX8XjDADK39aVLKW5ANKz4Rx8CpYJ9cYKu51w5EDqjpyZCK7/ajoH51jxSA4Z7MPZq6Zu9WFTYRWyhFFgWXysvqIj7ni0p0V4JFnBmukJbitYMt0Z/plBMCdaM57v1A09f/PH/Wtwt4sY0wl29eJ6xxhVqNKxd7NodEHWB6E6whMEOTGK8PWYPIv95Pobt0Od6FpoRZW4eziezkCcBBnA7C/gdUFIr7dHAjBctd06MXrEvjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hUwiPDcuYn9Hd5t30PyjpANSQ6ebHEF2FYkW3T6IzPQ=; b=bM+OW9vKeJjClpJ93nSkCpx9nS5ObwETconpCm0s8ptDvWJtCPwQhpd5U+at7m50G/6oN49rGTg+Bc067B3ZTiPBBBrNVnz1mCp2LttnDrij6EwSlKab4MC2Xw4EqXyyCjZF99+wWfbLuzJfZRzQQQ4fDxK6cXyItXzcUr4oGjWFULj+FumRfMoWQE1ECjxahd04vE8/cdZzLzhMti38PwoL2py7P9BIaTT3iZwbySAgGaHa8Tk0DWGmAnotRufaa61CvR4z2flHB5fNUrCO+Ts0Y8TlM0s4euV6fIHTM6twLHb+6Co/XWNSmrDgi62bmG27qWin5vP04vKfLk+w5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hUwiPDcuYn9Hd5t30PyjpANSQ6ebHEF2FYkW3T6IzPQ=; b=OODc2dumwUj+d7b9iUofV+Ai41kxBHn28dVAZcahiqD8EB0knvRGdQC2eEezlvw/2Dq4BJgZrOZCg3oNdNTZgFDGCJltt5H+Ec8VEYbBMSOypZs/vECIod1KzbvCyhGCEmWaOp5MoESpg35wlRkCmHUnWTMDtbb0q5LmWbmi6EsuTyYxVtqHFn350Yjm8grn85EaRqHnvMEeTqwAgvdgHpmtQOcs8ZJhg9f+C7QKogdiXchBTtox8WRWkpHFxE1BXIczwsFF8dZSR68cO1PslfeAWnQLWLx0YMYwq6VfrtTSAhIHZyais5GeYgJuP9x7fMGW+v0lCAODM6q7xl4pnQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) by TYZPR06MB5370.apcprd06.prod.outlook.com (2603:1096:400:1f1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 11:04:33 +0000 Received: from SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce]) by SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce%3]) with mapi id 15.20.7897.027; Fri, 30 Aug 2024 11:04:33 +0000 From: Shen Lichuan To: ulf.hansson@linaro.org, florian.fainelli@broadcom.com, rjui@broadcom.com, sbranden@broadcom.com Cc: bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Shen Lichuan Subject: [PATCH v1] pmdomain: bcm: Simplify with dev_err_probe() Date: Fri, 30 Aug 2024 19:04:21 +0800 Message-Id: <20240830110421.62980-1-shenlichuan@vivo.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: SI2PR01CA0020.apcprd01.prod.exchangelabs.com (2603:1096:4:192::6) To SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5899:EE_|TYZPR06MB5370:EE_ X-MS-Office365-Filtering-Correlation-Id: d42dda5f-55fd-4a0e-cc37-08dcc8e38736 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: JhwwlfePqXyEZfcLQBaYjrks4Lh01+ZZPt60HKMb6+iQPtHBsCn+uJ7ZLBtaW17cgbp3hy2ocMYm/cPgIpQ8SRyxpJdck7P368uwQsDIzeZ7sZYMxvvXhDwLuJrR/a/+8Ff/uUWo0y6wmFNXtfDIx5yHxMTCxGwWTN5+NsJAxeKajpyOJ4iAweKKx/dnvSgJiJszGjL9PphF80MXvLzcbAKdz7kRVMVKMRoonOsFdfi/5fuZuMkOYmL73vKsgXDIjrqzkfxSpCNKIggfADmoQjwcLUZJ/XIWhtPtAMH8UU0oJWTN8eGoLXWPlYqiWA+AiNcLTsOq8O0FyJV/RYKqrXfoXrmyUPjcAM2MvKPcMoiYX8F961Wj9t7z2EQEEko7GhzPfJI1Gl6aRGr83SbOrRAqNVEv6I43t76WUvwe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ZPR06MB5899.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: L7f/Htm7IaPkXUI0e3+Sh3Oi6ocFz/DwWNHRKtCCKhsb46OClpnGkpP5u7+YAXTIxlxyK0xJvEJWdgrScACv3e1a826B7Ezn9bHKUwWBeR43apZ66WBqNCVfbrM+F6SbYJYrtmgdMI8ph3e1BpGuU4QWvm/N1EmcO0dlTFhXo6fZR5DS7dXHgSeMYABQN7u+HC5Q6IwmzrFkf3CZXSB5co6sy+Q+VXbV4Zv8/FIR5JQSLsHQKFyoxsTdmIhwPzGcmabRwR3CVVFOJggOgBACfnYvRR1A+eLsCpVS4FidrRvV71VxgH4EACA5A65i+ANm8jV1i8VclslZWKEGVrD1Zt/U6cH04XCL4gk0mETFzc8R67OYv8C/Gy4hF5qPZvX5jCN6VnrfPzadxRz3LLkdS2S6tjhboZRNJQih4v5YCwZm8VyI6yt+CN2AQmpfDv/7KP8oS53wa/JVSYlAtLimJgF0qB5+YMGH82wATRwb8jPaP155D1dGFadoto4fapa19AxMC8vEHvau72od6vVnJXLFFRw3lmH/3o5KW3ek4uMGqVfGMJ7RsTS9EbVOuVa62gXyAdwIpRXfbpMQ7UPOewm4YSFEGpN4bcVWuyu0iW8Yp/gET36EOtuG/w/5wGWnCmuxPjUymjYLjFzPlgUHRPmnD6vD+PTEeboCeMKDu3W6GXLc+87w26KHqN2BV8xrV3I/ReJX2if5nNsXpchjCRwBbpsbL0IjeK5MCg2Tir5qDanL3s0Plo0DTM4DFoc0DfzAHbKqpG87DoOej7CYcRPFyKV5LZpwRYwM+YkoDjRe8n3HQcgzxHjmDz4wFUZMEcl7KO+JvCbqFPugnadQXAxdwR719bh80ziij0G1WPDY+zGd2XOitASEX7ZlbkM+XM5KrcVMD8zEc9oFPAJQBt/diER/CyB6/uEAGa4+R/4lOKWnO9W1A4KR3K45mLlY0xmgJAtaogmqnpQi7m0vL9TYGuhioVf7JMs4YpP2cQA5Mbf52cJbMf1FLo+FOCMEggDU41fuMVbrPUT4zXhQbTDFC3k/39iy3/8jA0gYFrMMkN3kk6WEAhraMPu6sra7Qlhj9hSkLS0q9MXTnoOT/EUEp+CcefkzqI0xw7epubQA9fss/c2cBfDiE5mNta32pAJH2uMUvmqZsREGi4aHrIM2+zhHkKkFzoo7B6r/AbWJW0Dc6UF2adQ0zD5bSL493FXp2zS75Ax9H2/lF8lUmJuP5XTXWM2Bm0olM4Vs/Jex/2SEu2UBGlVF3lmfbWK5ZQmAFPMJpt7GpZAhg6NlQm0l/xhOGnj/TTWxHoHqHTQn2Vkg/Sd/CQUvA4NxBBZexcImNPoUzFyCBsashANRyTxuJNJQMc8na9tGcMTDx4gOHVF4XeXA/l/Xqx45SQZ5QXtZcNxQyyQ586kpJ4emSfYUn9om8WyQMJwB0hnkiq/rbCQYjESf+Gmav3SzAHPkWox1genGlXgsKs25FCnZ+r3l/hi4xt5ByV9f6znlHH5gsc+KxSeNCNqNFzUCkYhiX6kR/mwHfcssaZJHzURA/NdCbn+RfgbU3zXdrMpMdsWmSFp/s/ngpm3YtSqZK3/Y X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d42dda5f-55fd-4a0e-cc37-08dcc8e38736 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5899.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 11:04:33.3479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: z17fTLejugunkdinGB4B06EyWhRNUcsIWubtbscC0Tkd2MCi4/zVoku682YaQo9mv8uTSDFL6u1w69ecIkks+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5370 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_040440_820661_A3B3CF0F X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use dev_err_probe() to simplify the error path and unify a message template. Using this helper is totally fine even if err is known to never be -EPROBE_DEFER. The benefit compared to a normal dev_err() is the standardized format of the error code, it being emitted symbolically and the fact that the error code is returned which allows more compact error paths. Signed-off-by: Shen Lichuan --- drivers/pmdomain/bcm/bcm2835-power.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/pmdomain/bcm/bcm2835-power.c b/drivers/pmdomain/bcm/bcm2835-power.c index d2f0233cb620..be07ab8a663c 100644 --- a/drivers/pmdomain/bcm/bcm2835-power.c +++ b/drivers/pmdomain/bcm/bcm2835-power.c @@ -643,18 +643,16 @@ static int bcm2835_power_probe(struct platform_device *pdev) power->rpivid_asb = pm->rpivid_asb; id = readl(power->asb + ASB_AXI_BRDG_ID); - if (id != BCM2835_BRDG_ID /* "BRDG" */) { - dev_err(dev, "ASB register ID returned 0x%08x\n", id); - return -ENODEV; - } + if (id != BCM2835_BRDG_ID /* "BRDG" */) + return dev_err_probe(dev, -ENODEV, + "ASB register ID returned 0x%08x\n", id); if (power->rpivid_asb) { id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID); - if (id != BCM2835_BRDG_ID /* "BRDG" */) { - dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n", - id); - return -ENODEV; - } + if (id != BCM2835_BRDG_ID /* "BRDG" */) + return dev_err_probe(dev, -ENODEV, + "RPiVid ASB register ID returned 0x%08x\n", + id); } power->pd_xlate.domains = devm_kcalloc(dev,