From patchwork Fri Mar 24 02:20:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 667140 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EFABC74A5B for ; Fri, 24 Mar 2023 02:20:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231454AbjCXCUV (ORCPT ); Thu, 23 Mar 2023 22:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbjCXCUU (ORCPT ); Thu, 23 Mar 2023 22:20:20 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DFD03C03; Thu, 23 Mar 2023 19:20:20 -0700 (PDT) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4PjQsZ3qSsz8R040; Fri, 24 Mar 2023 10:20:18 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 32O2K9qP002019; Fri, 24 Mar 2023 10:20:10 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Fri, 24 Mar 2023 10:20:11 +0800 (CST) Date: Fri, 24 Mar 2023 10:20:11 +0800 (CST) X-Zmail-TransId: 2afa641d08db27e-acd4e X-Mailer: Zmail v1.0 Message-ID: <202303241020110014476@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , Subject: =?utf-8?b?W1BBVENIXSB0aGVybWFsOiBhbWxvZ2ljOiBVc2UgZGV2X2Vycl9wcm9i?= =?utf-8?b?ZSgp?= X-MAIL: mse-fl2.zte.com.cn 32O2K9qP002019 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 641D08E2.000 by FangMail milter! X-FangMail-Envelope: 1679624418/4PjQsZ3qSsz8R040/641D08E2.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 641D08E2.000/4PjQsZ3qSsz8R040 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Ye Xingchen Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen Reviewed-by: Martin Blumenstingl --- drivers/thermal/amlogic_thermal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c index 4bf36386462f..3abc2dcef408 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -262,11 +262,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev) return PTR_ERR(pdata->regmap); pdata->clk = devm_clk_get(dev, NULL); - if (IS_ERR(pdata->clk)) { - if (PTR_ERR(pdata->clk) != -EPROBE_DEFER) - dev_err(dev, "failed to get clock\n"); - return PTR_ERR(pdata->clk); - } + if (IS_ERR(pdata->clk)) + return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n"); pdata->sec_ao_map = syscon_regmap_lookup_by_phandle (pdev->dev.of_node, "amlogic,ao-secure");