From patchwork Mon Sep 2 05:30:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhen X-Patchwork-Id: 13786727 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 818D4CA0ED3 for ; Mon, 2 Sep 2024 05:32:27 +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: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Eqvem/fIX0XGLiMzS6niOK+1FV800GGzQneLgN93B20=; b=ySK2salf5q7ZAgqDDto/NEkmhl lJqazuLT0xqblmvwJNLE+oFz99sw7Szqlhl81vFUVl1OfeMBONUZgskFL8ifPORVhc7mFfHBbJcA3 EHteSiGOECcATJIaomj/JJO9BfehW3WSaMbk+mY5UXV3DRbEBZx3zUD7SNyNqMuLGFaCQjF9uH2w3 M0xA9HGeMzOrnXc8lciqJEbSfEMl4JQDaz9OuSNqw0bIcktvgUH1qgueKpb/jUmZ85IeMR69TiVFQ 1HAzTorUEF1gM5JIWqdbNOlgo8TrHgrHmwxnChuSNzodY83QDVyIwTi1oANSk+LSGu+yyUNd99pDg ME3ZV8pA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skzfu-0000000D2EI-1LC3; Mon, 02 Sep 2024 05:32:26 +0000 Received: from mail-sgaapc01on20625.outbound.protection.outlook.com ([2a01:111:f400:feab::625] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skzex-0000000D1v9-1a9L; Mon, 02 Sep 2024 05:31:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MrdPs67zzLW8o0mviCk4Ea+Pq5WchGcxlz5YH0styeAFjHJsC+E8RkxywKpd/oqaQSSNisnOVqX9XAJ0bPKiaFw9yP5o/I8OME+id2u8kYJiR5GIZYmj4TzCBwRTBvy2/x2RtKUZnzwvPTpf/v4uc8aHtdiGaVDtdlEPpN07dxDwOobePaY5wssy9mi0Ws7gnWAhI1Fkh1WloHj0PzsMRP+leRtM4IK47cMKze9Dln+JHWj0JoH5byNvax3A9SN9YPOBlXWimKvExFAXO1SF3bqZl1HuoctZLr+WCVXFmk94D+jQmzchpLx4AiVl4zlvb6BwTMBwiZL9P8P5Ng+hJA== 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=Eqvem/fIX0XGLiMzS6niOK+1FV800GGzQneLgN93B20=; b=i8pqGAnYZ7LEB3T1OKqtpj/bRivnvsJ+EG46iH+F6jcsS5+eTvmYb0gt1fTnv5bAP4FAFZvuDkccsqEwbpa/dtfccTpPiXwZKYMQYVimTGUgPy/N8j80riLhPwiBy/DZXR+vf3yGW/WWaQE6m1XKJZpWm05uh2psukbyf3W8ZAfifO9jC/k5fSFzEoeQT7nHNvDOiOLwP2h2HPk3gJ5mYIcYI877DJNWePyudFmt/XH6tDzIeT2dXVSrFww+9LEKSHA1b/0dr50pgBJroAuDL+SlRVZ/Fhk8JXVnDvS5Uk7hKpqMHw/LNpS4vGNGIDx2lRXg2kOCXajsPwHYz2SRYw== 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=Eqvem/fIX0XGLiMzS6niOK+1FV800GGzQneLgN93B20=; b=iL9mIK35j20D9BFT1w6vD4nh0F0QiMKyyVpPp8R6K5wnXsyCs/ZkmFtzKwXfKNT9VgT37K9A7wxR9iPOhCXyI1nhdLtihygH6QgQdygWMHNOrT6pNeJudRMOUskll82CzwfsvMqiT6bIbvGKu03YFpX1uoNpSYmhsvs9Q6eE/j6gH5ZKJKCeFHKuWqHAb1XM0VY5uzjN8gssHn7+nnrQTTRkFL4poJGa0Ka3O61hyBCy93OhdvATdrMsDUuNOpNNrsUh2/ODruVAOcnf1edT8OO1vZtI5QzCRoVdBCnW/rgXQIa8W23XMNy3oeJ1ZK8Cz+oOEqpyuvKgLRQ1YFnxKw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) by TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.23; Mon, 2 Sep 2024 05:31:09 +0000 Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1]) by KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1%4]) with mapi id 15.20.7918.024; Mon, 2 Sep 2024 05:31:09 +0000 From: Yan Zhen To: matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, opensource.kernel@vivo.com, Yan Zhen Subject: [PATCH v3] soc: mediatek: mtk-mmsys: Simplify with dev_err_probe() Date: Mon, 2 Sep 2024 13:30:01 +0800 Message-Id: <20240902053001.930379-1-yanzhen@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR01CA0001.apcprd01.prod.exchangelabs.com (2603:1096:4:191::13) To KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4113:EE_|TYZPR06MB6263:EE_ X-MS-Office365-Filtering-Correlation-Id: 8435befb-e610-44c9-a556-08dccb107303 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 6m+gD8hvWWjF8YVc5P/Yc9zVxIq6K2r9JJGFwZxIaf3Gir9bi9z6l4iZshJVfXq+3B3QQ2Uf68S5mzMLLLZPrJ+iYwyMzlO7oeBg+4OOFsekMSa/vKJMWlqSZz9S7q2LNkW+8SfZQGuILGxSTOsY4qlfccYuZ3FDNK4/cqpXtIOlbsXo3qlVt8i4oKmnLLSXWUPK+ryUjU1WdsG9sAYgKFrPahmD9zwfgpkb8OyeBbe6jFm0V/oVWsLRyEmSZU4m2oVFxsd1RM3PHGEafsGhhb0pX8PmrolzScvfUeS9Zg7XKXclCKijzVQpneWkrtJfqnQmOgOc5XQ8eLo/c7tG7nqmCrhJrmqjrcG2yA4GTBGdbTVJ5RpwvrofStDOIpKblG+y+ncI+KXOUpmtuplaUSBFyxxlT9ObVvgByoc6MMGniODd9HX+X6EQXN9HzU54qTlBh94QiGQ4o9aIDYBxyxgdG84mcpzRT/v9FYi7K8Zzo25mdZOukuh8fapnBPr1HG/wikvImHaLxZaTo7j+W0a74G9sgsPDr/ek9HUbXPCX/E19BpnDFmjFNpIlg4yXP7TRLDAlIJ6IAsqqSLdwtm3EqARDwqcUUuulrmu9m7vb1KJ23VPbhb4ucqBPyXVBbz0870hMVlsPSDWqxNAgN8od+OnrCPK5OtN2g4JUMVQQr6V6JAeCnYNQog/vwvDk3ikbAGx0lQbGNRsIOkdj2cZrBLv8juD8sEEBuKi4VzALlwJMuZTChXhDRfP4jGevP2xwxrvhDSLJJXCtaf0YvZ1bUJrpgNjbtjt1BFwWc8oY0C249PoV8ODRbmbY0sYnmVZRL/R1nA4a5eVCxO5myfQp7ggTmR4XXr8wa1KcY3FLanoOBm2kZZFFAmrvNMhf0Ut0JlI91NedL5/YEaEKGYaZKckijkofCN3yuUzG+VhJeQP8w/+m5E0NMGqHWbpSULjxe1b/lvz+aXz9B7whdkaKuqwAaxvw5d/BxggEYiCXiC1PANypm9DhcXCqLNeBn3qM/tNlaHhaj6NMxw5sL97gw8BeV7V4ljkQySGSvOG7dFJ93hWcJBFCIo3bXFhhZv4SSEFqgEBNrCAXSF0Gz8gk0LyN+ufieCw74M5x0IWHtOpsInal2mIXbarLkJVb+l5vICaMy5ZTVrTG7aVs5tk1yzZc0V4PhxMMtIJh0/ZEZDlQcEVQ4hDPu8WACURG9a9sZ7EdrZLmnHTrPP4UXLBoOtDfGd/btVJlg6a2pLcbBTs+JxCunA0EKpbKhDZmhv+egnQj78MRVqEztG0AIpl7nZLQu2p8qMEHkQL9ifYufmsRCl0fmc85ptSMvEUfm67uXOTdgdwPkarKoQiZ4T9m8UcwO+oHYn6ejlVRq/Or45cpKVXWhNBdRFLew0t5UWm290QIZ5AXo4La1sat7Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0601MB4113.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(1800799024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kZm4Z0He/BShoaI+Au/DXNo4QCUHsSb8u/k3w/LHmYSHEXcW6F60LrirpYDVsJXJT9AQJ+3hIL6JitX1qyaBDWSjYop2NM7s1X7kB1DeN8mGH06fXUsd4ULhhfnJaDoEz+n56+eGiOb5YGP77lWIMXtQkJv9bdkhheZjUP4up3QSAH6sS07wLT8NSP+7a7GiboL3HIFN1LrqJlAIbty20yr1PiFKrh8+6PrsPuBAfaqTEiZ2D+Qd49nSC+Vbu/ro1nhHtigsKFcigT3eTZTOFmrDVaD5iKSMi5N71D4QzzjEiZdzdDXYeiH9q90Ju1XIPzOdtgw4RU4Io9BywedLtJtqHwu9hV6ubuSSY0B/lyg8pIiIrXVh29Y6+WtlsBLqaxtGD/CAzkRGhIXqpWBVlTXYeiDqgHm8nzSLv532yiuWLTa6dAhQYy1vZvr+sjNLKeVdN6JBR3FbynLNenxeFkBif4T9AOX7InGcS+b3/jDJAT7BIqCh9wRb6zMMZNmkeb/kQxz6buBSsLzH6quZrdD0FGJ+BdmV8JimBT95YWbMVG3947Mwj/yr96BqiOHZ2IXj8Z+BaJUO8njScAcSd8C7UwjMErbdHJPp+bJC X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8435befb-e610-44c9-a556-08dccb107303 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4113.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2024 05:31:09.0689 (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: sXq/oJvhABJ4Mx0qzKvXQpMs4CweOP3eq+uzb1sQL5LYmP2uZLBu2VUwBmdttcZd+x+3vRdRnDhaEbTLT5NbdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6263 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240901_223127_427379_14F810AF X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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: Yan Zhen --- Changes in v3: - Modify the message. - Add the '\n' at the end of the string. drivers/soc/mediatek/mtk-mmsys.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c index 938240714e54..170319163c28 100644 --- a/drivers/soc/mediatek/mtk-mmsys.c +++ b/drivers/soc/mediatek/mtk-mmsys.c @@ -397,11 +397,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev) return -ENOMEM; mmsys->regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(mmsys->regs)) { - ret = PTR_ERR(mmsys->regs); - dev_err(dev, "Failed to ioremap mmsys registers: %d\n", ret); - return ret; - } + if (IS_ERR(mmsys->regs)) + return dev_err_probe(dev, PTR_ERR(mmsys->regs), + "Failed to ioremap mmsys registers\n"); mmsys->data = of_device_get_match_data(&pdev->dev); @@ -413,10 +411,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev) mmsys->rcdev.ops = &mtk_mmsys_reset_ops; mmsys->rcdev.of_node = pdev->dev.of_node; ret = devm_reset_controller_register(&pdev->dev, &mmsys->rcdev); - if (ret) { - dev_err(&pdev->dev, "Couldn't register mmsys reset controller: %d\n", ret); - return ret; - } + if (ret) + dev_err_probe(&pdev->dev, ret, + "Couldn't register mmsys reset controller\n"); } /* CMDQ is optional */