From patchwork Wed Apr 13 08:50:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12811748 X-Patchwork-Delegate: geert@linux-m68k.org 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 1D3F5C433F5 for ; Wed, 13 Apr 2022 08:51:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234112AbiDMIxu (ORCPT ); Wed, 13 Apr 2022 04:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234367AbiDMIxb (ORCPT ); Wed, 13 Apr 2022 04:53:31 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F24645780 for ; Wed, 13 Apr 2022 01:51:10 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neYiO-0006X8-8U; Wed, 13 Apr 2022 10:51:04 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1neYiL-002kH6-UN; Wed, 13 Apr 2022 10:51:00 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1neYiJ-002yxD-Mw; Wed, 13 Apr 2022 10:50:59 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Laurent Pinchart , Simon Horman , Geert Uytterhoeven , Magnus Damm , Thierry Reding , Lee Jones Cc: linux-pwm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/6] pwm: renesas-tpu: Make use of dev_err_probe() Date: Wed, 13 Apr 2022 10:50:45 +0200 Message-Id: <20220413085050.61144-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1510; h=from:subject; bh=CA6sUWp+2onbHGId++hzJboYLYFVTVZJJ6p4WBfgdhs=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBiVo7SRyDyCSYIZpHCg2Hs/jQR5SNNsNjqCDyUhZ+E 2l9PJmiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYlaO0gAKCRDB/BR4rcrsCQXJB/ 9llofpQXnzXsy5ATK2QRKX8A7uldnxk63qKAofO1uts+ynmgIq03kS2RRYLvbUK2Yp/y7nFTzoOy/i drW6RiGAYZ9mznZFNs7dmS0B+5cN4oqQ2rx6uFQhCaqYff56Z5ifOs89Blf6wIb/3pD2rU0MDe/AEB FfaMRBqSFLmDuqnQVzkQWRnLhHh2NyP/PVsDbsX3ua0eaHagNncOWFvzQJUnjZJXWW3M2+WvfQChri VJIoQCwmyVca1m4kZBk274oAFn9YpsD803vGeUZzdLY2lGdxfdGsgyenr2XYj5BzOcHA8k46Ikkx8w 4ubZCzgMAwbeAMuR+ZUU+m+0+jy4Ur X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-renesas-soc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The added benefit is that the error code is mentioned in the error message and its usage is a bit more compact than open coding it. This also improves behaviour in case devm_clk_get() returns -EPROBE_DEFER. While touching this code, consistenly start error messages with upper case. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven --- drivers/pwm/pwm-renesas-tpu.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) base-commit: 3123109284176b1532874591f7c81f3837bbdc17 diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c index 4381df90a527..c3ae78e37789 100644 --- a/drivers/pwm/pwm-renesas-tpu.c +++ b/drivers/pwm/pwm-renesas-tpu.c @@ -398,10 +398,8 @@ static int tpu_probe(struct platform_device *pdev) return PTR_ERR(tpu->base); tpu->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(tpu->clk)) { - dev_err(&pdev->dev, "cannot get clock\n"); - return PTR_ERR(tpu->clk); - } + if (IS_ERR(tpu->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(tpu->clk), "Failed to get clock\n"); /* Initialize and register the device. */ platform_set_drvdata(pdev, tpu); @@ -414,9 +412,8 @@ static int tpu_probe(struct platform_device *pdev) ret = pwmchip_add(&tpu->chip); if (ret < 0) { - dev_err(&pdev->dev, "failed to register PWM chip\n"); pm_runtime_disable(&pdev->dev); - return ret; + return dev_err_probe(&pdev->dev, ret, "Failed to register PWM chip\n"); } return 0;