Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp156851rwb; Thu, 18 Aug 2022 01:08:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR7xqEkBcQdt5jutHRVWd0/6gom3BttVfYNCfjpHRuS5fbjNfsiy3wb4pDbTz1OUf76J5jiO X-Received: by 2002:a17:907:75ce:b0:73b:dab0:8937 with SMTP id jl14-20020a17090775ce00b0073bdab08937mr696204ejc.568.1660810121086; Thu, 18 Aug 2022 01:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660810121; cv=none; d=google.com; s=arc-20160816; b=DpsHMhreRwDLEfWRF8Nxw3Ynvxg5rR6JzeDfyv5kWnCzwR55FIoevoD36Ows3M5bAM 6QWWPB9GWCxyBupBXLmTZSPReygrnkpIyD9XaNz9uayfycbaa1t1fLGXWn2oTZzdzNQ3 xl8N4JTDZsgCx3sm+RNxgf4jpDUx6e9Cp9ix+dgHqpwcMw/MCuKcXYKU/T+odeIFI2K2 bY8zyY39yOtQloAI4UL7Efc1lLaA+TYTw+cRhsbStv8o41PFNU/V7hGwPLzykY07ZmWw 4n2cvbw2gulOQNhtC65sXCk64JlNBOyoJ66JXArSQr8Lr8GM16TIej+5wg609FgQvptb KOOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=/5rGRw+dVj7zKcsRQdt0zxLrGiduSWoxidUGpwI48Ns=; b=rqriLcmjdyw7Mi9HfqgqQkLbDvvLk6PMoKHU3eUtZ6FpVPj6hp1ULSVfKJnCl1Yqye YlLrmIG0D+DFJtY1lXevBTtnTEpsZV+vk2xUMaw7ssc1uPHpeVG6oDu9NjRuzqb2VNvF KXO/pE82L++P56VCESXdhR9ZWCfDGL1af4rpi8e+0dwSdOV5NOD4qOEwku83qCmqhX1D n6YXwYSlyIWBrUaPFDUXGKzRe5Y/GkQSX8Mw7Ngayc9U+8gWbc8lSmL7a+CFHmPQZfWQ au5qUFwyWP7SDY93XDD7gLtBDBwOMikHUw75ntYHXo9PrOkF6hbGeC4vHHVyBhUbjnZG /Bvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a056402035100b0043a6ddb2941si647257edw.253.2022.08.18.01.08.14; Thu, 18 Aug 2022 01:08:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243959AbiHRHzu (ORCPT + 99 others); Thu, 18 Aug 2022 03:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243928AbiHRHzr (ORCPT ); Thu, 18 Aug 2022 03:55:47 -0400 Received: from smtpbgsg1.qq.com (smtpbgsg1.qq.com [54.254.200.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B4D35A89B; Thu, 18 Aug 2022 00:55:45 -0700 (PDT) X-QQ-mid: bizesmtp84t1660809306tfbj0d7x Received: from localhost.localdomain ( [123.114.60.34]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 18 Aug 2022 15:55:04 +0800 (CST) X-QQ-SSF: 01400000002000D0U000B00A0000000 X-QQ-FEAT: swyrzWPvyR126b+3X45NGrMtYKOIt069w4aDNOSi6iisZMf2/tX68YoUumWdU dYtu6KOzDzJp5DTHprLCLdTDk/HozhmpvMBqO50ftUSwnZ1sEFsZzUY+9P+BnMWGgmIRf0J Pi+oXlJurIxQ4+Tp0mNse+USKqXdq/BeQ/c5FoaIOncNBctTd6orLUGUU7UONotXwlUmi/X 5b3blDEg4Qk0h+3VS7CmGAn/LfYKvk9f4fLpioRYrxAfe+Yebwkfor6t7znjPu0hSN/NyGA Leh0PteLePdOFDYWTU0d0NK4S2i7QyB12JHw7Qgks7Lidg1ps0FZfxlH9yMMsvzOzGsfpwk m/yZizGAVWtsrZo0rlk683Cd6cpHIqk4mulVFef0SvOq99CblVLwx8k/X47uw== X-QQ-GoodBg: 2 From: zhaoxiao To: thierry.reding@gmail.com, heiko@sntech.de Cc: u.kleine-koenig@pengutronix.de, linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, zhaoxiao Subject: [PATCH v2] pwm: rockchip: Convert to use dev_err_probe() Date: Thu, 18 Aug 2022 15:55:03 +0800 Message-Id: <20220818075503.18442-1-zhaoxiao@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvr:qybglogicsvr1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: zhaoxiao --- v2: remove the %d in the message. drivers/pwm/pwm-rockchip.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index f3647b317152..c6e088c1a6bf 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c @@ -330,16 +330,12 @@ static int rockchip_pwm_probe(struct platform_device *pdev) if (IS_ERR(pc->pclk)) { ret = PTR_ERR(pc->pclk); - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "Can't get APB clk: %d\n", ret); - return ret; + return dev_err_probe(&pdev->dev, ret, "Can't get APB clk\n"); } ret = clk_prepare_enable(pc->clk); - if (ret) { - dev_err(&pdev->dev, "Can't prepare enable PWM clk: %d\n", ret); - return ret; - } + if (ret) + dev_err_probe(&pdev->dev, ret, "Can't prepare enable PWM clk\n"); ret = clk_prepare_enable(pc->pclk); if (ret) { -- 2.20.1