From patchwork Fri Aug 30 08:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yufan X-Patchwork-Id: 13784498 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 DC5F3CA0EE8 for ; Fri, 30 Aug 2024 08:06:56 +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=0XZq6n0Dv4iLZQWkJkQKPGNPoR/wYUtrmeOz3rvopVk=; b=uw+f75iQrp1wYoZyanzfs8m11E lJnOfeaQiH623PzAquS/YiOa9cIG/owRFQII1IYuYMK6eiv038O0IbHLP0qOqyCltNabdxDIq2PuB rIRu0KwvYtMjPKy7+zwxmNYOkgJEJzbktFUYrMdAGn8WLBAWmFZuPZyXLWyAW0YXgS+Ts+wJM5lMi TpQTOZGfIKgavKYLvOVQUv4//nILe2bzL8F7tbKiXuBe9e6f0YW9xPyKNQox5vCgam0V4KR6iBssr 9T67y2Jo7jSrGbbL8By9ypgiAOKPmYInh24gsjTBItbRo+svMx750fUuz0uf7Ypo8NwRHBUkqxxqw XXbwID/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjweY-00000005FGw-2z0R; Fri, 30 Aug 2024 08:06:42 +0000 Received: from mail-sgaapc01on2061f.outbound.protection.outlook.com ([2a01:111:f400:feab::61f] helo=APC01-SG2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjwcF-00000005Eg3-3Jl4; Fri, 30 Aug 2024 08:04:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fk1aRxfVor6TOYP03hiebdujzUhvmzGU1xhJYA1atmv1W9+CDIifNU1r6RJKk3JE1zao9KFlneZNK1m5UdVJgkD5rvAUZiXBXkG1Don0tr+sSyl6kNHduwpyTHLsVfkNtkncQ4feoxnuAzI5p1uRDiv7O/J79yBuPDSTC5CHeE5L+Zi2u2cIi1p0gGCwNISLQehn1kOVvuEvN8YwfOMLHk1z13SFcOVqD6zWb05bTPX03kVwlJ6fK7Wrd43ELL0f3lav/OVCnOBKnX98efgd2Cgnj341IaTwX3RuWm1pVjPm9DGRqg2QxtsrMVOV5xvbvEW2llqEB25KgGYKbaOgtg== 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=0XZq6n0Dv4iLZQWkJkQKPGNPoR/wYUtrmeOz3rvopVk=; b=LvwNOtLiVNaWFY3B0/NDSTHUnuTZH1Y2+QAdBXgtBeRh3EyqxfZnAC4HAxLfcQh6JmiunRNA6RiB8T1QSpNqSMm3KRamd65rh2Iha+tIYr8hJCBDfA8bGPCNiMbqE6EApthIK4acXNlDig2T4awcSS/o+0T1vaNnIlBg68stuOgufYl7mEpsr1WRet0IIqQfLe8/e/XbuaFL5BZz/0likONqDLbZ4Qsy5sUpeuBpnoJ4IAk6r6o6wEzsf7IVp5nOsV52yGprxgV7UKlkYydhKpNN4ybpYbDwCoXX4YPFu/OFTAScCWb8OKZw98qqcCAHpKt0uPqOkhwlx8pwxbFvxQ== 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=0XZq6n0Dv4iLZQWkJkQKPGNPoR/wYUtrmeOz3rvopVk=; b=L1rulOsAxO/NhsNptqUpDsTgMRiBHs/jy+wV32Noz9kL/6uXwqAXNWPDHg65XyoBMIJ/1QZGn/tkyC2cgLDp8XAEM4XNUljSww958lPJMxMS7QQRFSdXem8CkDcYCEwa2g32WegC7rd8uCPuTMb8xXbP0F9qU0qOc007G8lO1t65E+FijQicXCeK/3lsYCtvOy/c0bGBD1riT4IIOD4v+SHLGJ3s3e29VGYhIoIqtppVCXX4Vj1bCWw8xO3W8SOPQtGR6bshnkO5w4QD5AWB0uvuVZVUo1iX+llqzs0tQkMlvULTvV7p3G7UA5JkmRC40jTElV6rrkwL+xYUwB++jw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) by PUZPR06MB6068.apcprd06.prod.outlook.com (2603:1096:301:112::16) 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 08:04:08 +0000 Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f]) by KL1PR0601MB5487.apcprd06.prod.outlook.com ([fe80::2129:59e5:6c67:311f%7]) with mapi id 15.20.7897.027; Fri, 30 Aug 2024 08:04:08 +0000 From: Chen Yufan To: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Kevin Hilman , Martin Blumenstingl , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Chen Yufan Subject: [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code Date: Fri, 30 Aug 2024 16:01:03 +0800 Message-Id: <20240830080103.12811-1-chenyufan@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SG2PR02CA0123.apcprd02.prod.outlook.com (2603:1096:4:188::22) To KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5487:EE_|PUZPR06MB6068:EE_ X-MS-Office365-Filtering-Correlation-Id: 778a5000-be46-43a5-4492-08dcc8ca52f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|52116014|366016|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: KgWRT2m+b8C/ima6GZEZXzYRjuL/V2yJxNulSKSqaqUk6Oq/CR6eH3r8z87caUC7OoZgcD95UkdB/cgDQgyKd1rj36mHgpAaHzIOj6wfF/CTxRwa3FV2zxg29qACMCLo23KPr36J/8FpSTxV4R6gWjKgvPD8UwLCa8/eOp4/UInVEsPu3LpyjmihBTy7reBKPtwI4zzI/LmwvpwE42Kti3luHSonFXoCKOUvDJofWt0zKD5sOIxcrPHwWudwR8PD+xzTFsmMsE/o35jZj1CHiMN57EV58rYWNShZtbDcrKwPb+W4Z/VxGIH72OuEgZnnJh7FDAe7Yril5ffRkwgoT4dw39wAHcg8mfYXSuXUy9b1MRwikDgLkzLtZNHMMEKAb3NDAleJvJSu+7GlLL8asT0zDD+uYt9Det+jGnhlg5h90UOJJyNSCOa4fqckzVGUSqtINSnitv/NJ+I0omO9XLq20kTWiv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cprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(52116014)(366016)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b3BpCobcvDdPrJZAkygXKOLr5VLLOKTC2fxvtPM+8ugy/ZZvEgeo0ySoFWLs7l8VbYuavp5nFyLnpKDC2qrSayDbEIpzohUOc37CEEEgDytv6lKi1smrGeQa7D5Rpcj/8LPN7gFN7/mnS2w+IRSDTvfkpa/LJv9+7+BlVOD6aSgfDJcWW3OiBw7crzcZCixIlm70mPN2DNkKBdI1OpbJoG9lpqkv09lC+MFpUq/pX0mZFZIsqcrAYCcya1+Fdj7MNgftC9mKW81gLlAvm2JwrV1ATGALjHBWVTxbjXmcItEHzJr16batelZ6AasVpLBwgeyhSztQBNurlwvnSwB1ldRS88Lj1hbgmi5qZ6Z7YJtqNJ1kGq4dAm4cYbVECgnmgdR1KxFLecvU38A41lGLfQoAMGWX+tt0INbVOEL1ibXXIUuwL0LUBQE/deBpOd8HQsJh3E3WrJLSkdWzPwV8r2ICtyznM3iBoLK6wbn2H5khTVqf9zTfUy6bWqQuPcue7sKGL6GahlBxvaOEfWxWO1j01i7LwiOuGmEN3lPMrwJP7B+bauIz4EOksR6D46gOgKbOjVKtiYC7dd6qZpBDIYSUb5ai3QepJVI7JDqx6RDITMhNnXeqrQ6R+2zHgBJ+irUtHiiD9nwctzlEYwcqGb6LVETaxGdVmlgdOeTZ45dG2GRwkqmoFsqVdxI23u7xLdB12x6EX9pF8KwCRwMp08cuINrBprlRBQWj62CyJYs8UdY2skjzEv6k92cXTcY0X3Rn5RzmZ/650HBV+xvU8oeYEQeG8mPk51np5yFiCQBdVOzTPWjO4JPUddBksO+/MOG0q0WnvKCXH8F2U2WOyPt5oE67WoYxCThHyGsP+cCzFavDe4WH/nWZhT9CUzOVf1jMQjL7LmvODGGsT4KuYVUsxMpImjRAfPm7SCgKecK3hZofs1eagoWPZTPB7XAU83aZEf0bWnOyuwyTxFuCjapPaxq6qvEUHCeybiryCgJe96mBjmmPd33SUFiF/OpA41dtKCx2OM+khH4PJ4vwd4bk1mifEw/iUf5y2lOeNRZJQcUljle62U0XVwvw6v8llkj/E8u+HrYRjZl5iLOK+p711UdQFxdW+heLOqxOVcCzkInnPVU25JYkSYtAVwA10D1eiMY7Up9DJhkBpxQh+cao4Pg6Y4Zv6RmM3mW1OcJIH55dG/Vk8kIQ1VowcwOXYVU6JaJBmukll1lQ9KGZRcNX3NDlKAYTXan3tVhofMLeLQ20umxZGHZQ/DCBBKy1OMNVDoXrJSELWJPFMfZJlWw4ssMySuUOqheQLGZ9Pwg7VYkfxtjfIBGjkuEUjF6SMG4IpTRsdQsSnz6zk6pHZ84kEU5FiCe4+7JkWF+gDIlahIZfOy9LFYO5HW65PsIHu4USlyvVpmlvHaQw3kmNv6A4ya4ra6OyGP9Q+1HGPccRwf422SKHQNoT75OoFl0c9aGRbDJLHpnFNwpx/QuM9e65s7JuytkhKuBiqD42m8DfgrUV2zvKD8RbhYzb+d6q3xVTc8szhDQVHttC7ugJedWX3zGQR7dBYJC4hiwECbeg1/VntjdMhYz3EEELmKiu X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 778a5000-be46-43a5-4492-08dcc8ca52f5 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5487.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 08:04:08.2186 (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: gok9zHtn0TyPLUHaN3pNwijzm8W3U38lx5mS+wAXSJRmW14xDeerj87NLE1fSvBicdkp6APDClHK9YahCXIulA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6068 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_010419_865585_3DEFDDF9 X-CRM114-Status: GOOD ( 10.30 ) 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() can make code a bit simpler. Signed-off-by: Chen Yufan --- drivers/clk/meson/axg-audio.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index e03a5bf899c0..0637b05a4c89 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -1761,10 +1761,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) return PTR_ERR(regs); map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg); - if (IS_ERR(map)) { - dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map)); - return PTR_ERR(map); - } + if (IS_ERR(map)) + return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap: %ld\n"); /* Get the mandatory peripheral clock */ clk = devm_clk_get_enabled(dev, "pclk"); @@ -1772,10 +1770,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) return PTR_ERR(clk); ret = device_reset(dev); - if (ret) { - dev_err_probe(dev, ret, "failed to reset device\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to reset device\n"); /* Populate regmap for the regmap backed clocks */ for (i = 0; i < data->regmap_clk_num; i++)