From patchwork Fri Aug 30 10:49:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yufan X-Patchwork-Id: 13784911 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 C3B6CCA0EFC for ; Fri, 30 Aug 2024 10:51:25 +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=u33YJQ197CQxZ0E4S8bLPhj/t/jYVEDkAB8H4kFJeXM=; b=J6UQNjKIqU6zLvsNvn3FJl6FIv Bf9W4kZaGRCQ2E9YivKDQEovB14FaS8HmNqjfKJGcd+YACU8M/F39bo252PDdgD+bkE4m4lAzBizu FsqxpvdJkAgn2L9ypcHg2OT0im28zFN0Cu67g+vqQCCmnGx5HcNm6gYTIbNVrsubzv2VN4tBzfDlq /XtGierXzxe+dRyKyU67fyKMAZTcpXOUcJsUTKEfknOPYLlPPT18bOjy1xZWUx4HhR6SfFoQsb/bs yWz22uXll3AzYWQ8l+IVaO/gAr2JLWYCeabPxXtBw/JVxsOVVJbS66oac22YdAh0sijppVJPulw0W ItL5mCLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjzDm-00000005tpa-3f7v; Fri, 30 Aug 2024 10:51:14 +0000 Received: from mail-tyzapc01on2060c.outbound.protection.outlook.com ([2a01:111:f403:2011::60c] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjzCv-00000005tgC-0n1U for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 10:50:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=x1K/u8igbzniv4reoPlSyKZ5k+rrF2Z3LGAXE2EBVrvr/W7Ym97cex83j04gyWrpbzwcJD37xAYP66t96HdqWC2We9j27jH0/EOo53qkQ9IJ/+HYkKTSbaS6XulV+XujuX2aBWzIeS4l94fS5OtV195W/wGwYL3OlSrBZCYxUAMeRl0B24gGXH/cv929slfE/k3mqMvqWBKL9HOZLftm/I1Yklq5ZV1jAkknR9zkscWWwGKLSMcl8belyVhsydFWLYnaVbJrQ7dCPd2KpStlCsdxBQZOmGjqfhAwUX7dNIysvOHl2+HFht8DIH47MY9Ey1Ey+6nAfd+Vg41OsdV/uA== 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=u33YJQ197CQxZ0E4S8bLPhj/t/jYVEDkAB8H4kFJeXM=; b=uGFGh9AOS0Cruk3Fj/4cCosihF9sCw9Q7OKuQt2S+r9Ne3oHBhAsBLSF+ojLOnE7NO6DOV9CvpfkeHHXfdSdrPy2FCRgMBL8kAtVvv0/Vz47t1iRRi3AMHPOS/BgVSjFHi7L7pkc2ZU42y/iUVnWWKWGM9tnVsNG+wF7Fr5waT0gY12lZZZvREBLbWJBs92UluKn4lKwz7AW4qMgLMiBJzRX6aGsW47+qblPckhpDwdpiS7s6LM0ayzNCXYy5Yt0JiME3dnILr6VC6537Q2JRGN9x3JEfN8GtQgwD/sG7FvRTPVmOmW6XCci+JudJEc1S4202Ll+JsOVaUGzs16q3Q== 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=u33YJQ197CQxZ0E4S8bLPhj/t/jYVEDkAB8H4kFJeXM=; b=YPO/5G9JTEgjrxYX0BFbt7AHuTITf7/vbAkWIXBTO0b3wZP7ocXRCFZK6FkvZT74r0Mfx0NEipxhIbCVMtmd6r81Gn4buZfbeLk4+8DZxXORVbJF4WqEM3E8Uub1idMOHTwBIDrI311luPkfyn7CqeQKTL2W5jYK+ub5Xz+pERjhvGUrvMxFbpfsS3un8DnTAzy5XCifd3crd9GIgmQVktXViUkb1mUcLPXGu45or8BQqn90CUdWJWrpoKB8qT0LQLr16RYUV4f5i4JeAkkNMoxLQ186NN91j4ztyEH1cW0ITqupQSIQFd2y1BoZGfQt9B26HbqmzhlPbDCGFD9o1Q== 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 PUZPR06MB5888.apcprd06.prod.outlook.com (2603:1096:301:105::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Fri, 30 Aug 2024 10:50:14 +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 10:50:14 +0000 From: Chen Yufan To: =?utf-8?q?Emilio_L=C3=B3pez?= , Michael Turquette , Stephen Boyd , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Chen Yufan Subject: [PATCH v2] clk: sunxi: sun9i-mmc: Use dev_err_probe() to simplfy code Date: Fri, 30 Aug 2024 18:49:58 +0800 Message-Id: <20240830104958.21775-1-chenyufan@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: TYCPR01CA0087.jpnprd01.prod.outlook.com (2603:1096:405:3::27) To KL1PR0601MB5487.apcprd06.prod.outlook.com (2603:1096:820:bf::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5487:EE_|PUZPR06MB5888:EE_ X-MS-Office365-Filtering-Correlation-Id: 77ae2106-3e16-4a06-b482-08dcc8e18708 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|7416014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: snJVwve+71hXgEPs7mbSczbOf0Eevoekq2vgHZLp1OdKQeDKteuBfr/ah//pmHk+6GGDmaQiCsDiuA3R0QTyBIEb2IlwOxmWGeSj01CxAxBPJQE+7JshuKYwtMgsluNHXSjqjp2ssUtCFh3nkripJlB6bq0zNTpjeOqJWupFJ4M0ysjUICMM2Hen64p0A7ZNvAC6pP4XAFDSOG0MMuS1i2jGqUPm2X7krrJm/NIz9UPMVeHOwnhQtSqEw+/K2BAh15VCm4TLUgoEz5Y267XOdMZpgSSVV4JK9qeQDRvxcEVsHSiYpz013iK2XjY2XfhhY4iKOUQJrkrpmQzWyaVb6FV50m6RQfT1KUP4s+dld+XL0qWlLBrMI64vp5Q9hJnDE0SuFFtsOc30p6L+scEIEwNke4BcXlxprFsEdr1c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L:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0601MB5487.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xUZMfjC2gopzWpFN94LYXZA+XfLfIoEx0rWWpcm/Lpr3ivB5YVuX5Pyhn2cBbwo6q0O2CXwwLf9MhDN4evyIDXByJWe9A9CjZSEx0ltxvnr3BYAlDqWHLviTKd5bVeyBapYb84mOQVcgFojNqT0QAdLKqTOVeGBSpcbAqeXeebz910tyJFP2y3Rr0gYZyKbAOZH1PvdDzo6Kwd5FhgEm26cF0kE5y4NRI4Ah+jgZxlljKnK0Au4DWJiyA/jQwQDfvemzS711m4gGyOV0TpiDOm1P8a40PSpCf+wd/ikgGcusyzIDo0fG7mS9JLdj4bMF8cWVBFfvU6NP5n/nFIrvUnnsbbsLqTT83pWhlQTxOFr7GcZi5I8mKOR8xmMHBRHNnYiLjZ625G9pKPbmwlm031RRrL2Zh27K47VIoJBSNUOlKwF4vEFBiyYLSJMs6zeWiaIRFqd8G01xi6h+DJrgMfobxO3IRhdeV2fgpp2Xelxy8TM/YjkgA0KTEgirbNxHCzon9Crkpv8XmpsHU0CbGjBRHA44cAmqV5Dc8zxOKuIop4Ks7jszqryubyFDPGz7HvmqOfrnRFCnYzC5BvQkoIVAIoNnS9Hq6DDLef2qiPW2al/hrYj5fJrbYLZ51F94MXRsm9wplG53vpxbeZ6TpBitsisab+X4Sa4urfGwidvyAl02yLKR/Aafbtj0FFGgb76Hi5wgkCWd7I6UwZ8HcgIV3zPelwBP0qaB9QNQ8Qh/WMqBrt0PP3Ui4IlVrimWEWi3jzb0DdjWpny5jmHXtxP2cjafL8h6Gq+czANwoB8saUm9xegE6A15XWNA6hWaXpQJOQDP+ThGG1a+XAY7JSqWe79rKi8xGzPv2kaPPV2tcHNC1/+vYTpwRZjMp0lQ27xrPy58ZqHXrWXUfhN8U5fPQ/1PFQZJhF9nMsCrUW/hwJ1uMehbR6h9x59xh9jlNRGgM6CDq9+QWU9Q5pulPexzvQcEyyaHmWGspeNtSD1CHoujmb8litQfStVtifEEfUxb+OO6hVL14TH6C3vAY9DxFgaNoRhHC+gTm37D3mi7Vs2jamvGxF7509qCQWKIP9VW1mroojyCO6esPr0+Uofd/G3yUMLsTbSJvWlvxoDxngT2XfQ/9FUBQqSXu5wx24US0YapC/QOQumia/QZsLuhTiySjnrXsaSPce6owz1SIedcdXfhyI1zmYcAHACsV7VEQIKaTuxY+AOLqjaviUrcpHywajE5kdgvxH0oWGD65pAqY7b+fAI+0tRxbjMxoR9I/3Y0+9Sr7lE0xQyJL5anOofR4uUMhz/Oa811D12cR9nGkoMgg4/9zkDYpClc5MTBv87nkmttG1h1xGUjS8s90+/G2pGr1Eg/af1nZV6hKKUfJUGTRaApXI9iglyyJntcobCmyorP5DVNTtS831MAzCdVpzDSbB3PXGw0Me5qHhxkGQY7IYw35bA0qyLuUMpG66X8ATQrYN4pUEa5VZwDE31AbPv74kppitPM4o3EJ+iU2RYRpGyoXbZkUKBZvFa26WNZiL16iuRg4r0JBmsj6Dqi42qT8LTrJl1G3vavy60yD79KDeYTBpdMvkLx X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77ae2106-3e16-4a06-b482-08dcc8e18708 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5487.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 10:50:13.9993 (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: B2xaAlnhWq7008ydHB8EfUu+CzBMNRvpdZT8UkIZ64KJuKeTNQ3Zraen3/vXVXl8sdcyY5PD6tX1RFmp2dhL9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5888 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_035021_255086_99931FEE X-CRM114-Status: GOOD ( 10.59 ) 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 --- The modifications made compared to the previous version are as follows: 1. Change missing dev_err() to dev_err_probe(). 2. Remove the extra "%d" in "dev_err_probe (&pdev->dev, ret, "Reset deassert err %d\n")". --- drivers/clk/sunxi/clk-sun9i-mmc.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c index 91074017c04f..6e65692dddf3 100644 --- a/drivers/clk/sunxi/clk-sun9i-mmc.c +++ b/drivers/clk/sunxi/clk-sun9i-mmc.c @@ -122,22 +122,17 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev) return -ENOMEM; data->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(data->clk)) { - dev_err(&pdev->dev, "Could not get clock\n"); - return PTR_ERR(data->clk); - } + if (IS_ERR(data->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(data->clk), "Could not get clock\n"); data->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); - if (IS_ERR(data->reset)) { - dev_err(&pdev->dev, "Could not get reset control\n"); - return PTR_ERR(data->reset); - } + if (IS_ERR(data->reset)) + return dev_err_probe(&pdev->dev, PTR_ERR(data->reset), + "Could not get reset control\n"); ret = reset_control_deassert(data->reset); - if (ret) { - dev_err(&pdev->dev, "Reset deassert err %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "Reset deassert err\n"); clk_parent = __clk_get_name(data->clk); for (i = 0; i < count; i++) {