From patchwork Wed Feb 14 09:32:27 2024 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: 13556176 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 9B66AC48BC4 for ; Wed, 14 Feb 2024 09:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=VmxxEt2P16HKl2bLtgleyETD8pey44jE4O8ZdBmOmqo=; b=BCiy0+kFfe3sV3 Jf/9D9p2F0xzr9NlTnvypuWts1K3g2TmrFPee5272w+zciZ99loZy3SIkEspIGaAhMqI82cilkbD/ HOWvAi6defHbt5zqx7dLvnyPLov6kGh8Pc62t6WSdsYMJ5tg9VNbwJHMI0SmBuS/nHAw0U81wVyoL VTuLHYQcO/XRk4aHuYtELHckD0cw0hY6TR/tdXA+u1w3NAx+bperBMDpC+oagyJRbstTINCU+sGYf sZcbsftQGAwJih3MFqFT1I9xCuKinedhljh0lsGMPXGk3aeI2Zau8fpKHFjaCvCPwX31l5J/auSUF UeZDTImxND9cteNE4HTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBjX-0000000CNYa-02hZ; Wed, 14 Feb 2024 09:39:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfP-0000000CKkL-3cUq for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Feb 2024 09:34:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=RDFkRMbFbMpJimums6TUBPxNmUEcesgpLuxKVjPrY4s=; b=qqf947EusOzGCBZSUjlnSv/IVm 4pfR0k2kXdcuDefAFxPhhvUSdft6smCye9to7AncNYvn0rHrz4EMMd3/ze/SKSuUZo35ZjpnV1rbi O9ts09ETjyINNTuUbrcK4d23Jxoz+mWMNXQ8YYGWvFf6WSOqj9ZcgXF+fUm5ZvMcuVZ63mq1roDhj vjCvVzitj9bAVTWMZtiV3igjnEk0UIOQdIO4yZhnlA0pplt8cqnt+S4y6RO2xdy6/GFvtzu2er5H3 JmCKVT9IexTXQnqih98HTcoGKoAig4LDrQy8ZMJqEGnqHDpo0ysKyp8u4xK5LTpjSJ2vZtaGNQWN0 JVnHDnHw==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfE-0000000GAXL-22mN for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 09:34:58 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1raBf3-0005W0-9f; Wed, 14 Feb 2024 10:34:37 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1raBez-000fEx-7y; Wed, 14 Feb 2024 10:34:33 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1raBez-004Y6R-0Y; Wed, 14 Feb 2024 10:34:33 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , linux-pwm@vger.kernel.org Cc: Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v6 100/164] pwm: samsung: Simplify using dev_err_probe() Date: Wed, 14 Feb 2024 10:32:27 +0100 Message-ID: <27a55fc05eb13802c9eddc600d0460e279388999.1707900770.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1964; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=mRVaVzxOuHc8/iADtJONL+ijTkKUJ56s+MALA1iYH+A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlzIi+D0n05TAovcPWo0WShbw+vCNK1F8jTDUqD VLx1zSxmbiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZcyIvgAKCRCPgPtYfRL+ TpCFB/0WucM+81bYSS61dW50ExWjOJcYGSvOPnQh86vjDP2FsfAuR6/MnBbxOuWV1aQgw4UGKTO JhdTTmA3lyMwhIqjQhFy1j9XUmAYP2DA41As7r96QCRauDEZ4ZHvneHWID/YgNIhsYhKC5AiPWW HoxKRcFryR23chuKQ4KvbMx9oQE7KKbd6J97dhEwHn16DdHN+BgZEbNqnxMlxV7JHekTJFZBO0h B8MYZDYDFa86cQX8HkHIERN/2EKeFeF75yXmrEMSOSr5PKDx776N3D654B7j9fg8b2euxdPNMAD CoI/fmjmjjlQPJfX8Hyx5UyIJAJiG5XPqfXh72tvt046zXen 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240214_093449_023450_953E0906 X-CRM114-Status: GOOD ( 12.73 ) 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 dev_err_probe() simplifies and improves the idiom "emit error message + return error code". Apply it accordingly. Signed-off-by: Uwe Kleine-König --- drivers/pwm/pwm-samsung.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index 81a2e66e927e..d3dc9b5b80d6 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -564,10 +564,9 @@ static int pwm_samsung_probe(struct platform_device *pdev) if (ret) return ret; } else { - if (!pdev->dev.platform_data) { - dev_err(&pdev->dev, "no platform data specified\n"); - return -EINVAL; - } + if (!pdev->dev.platform_data) + return dev_err_probe(&pdev->dev, -EINVAL, + "no platform data specified\n"); memcpy(&our_chip->variant, pdev->dev.platform_data, sizeof(our_chip->variant)); @@ -578,10 +577,9 @@ static int pwm_samsung_probe(struct platform_device *pdev) return PTR_ERR(our_chip->base); our_chip->base_clk = devm_clk_get_enabled(&pdev->dev, "timers"); - if (IS_ERR(our_chip->base_clk)) { - dev_err(dev, "failed to get timer base clk\n"); - return PTR_ERR(our_chip->base_clk); - } + if (IS_ERR(our_chip->base_clk)) + return dev_err_probe(dev, PTR_ERR(our_chip->base_clk), + "failed to get timer base clk\n"); for (chan = 0; chan < SAMSUNG_PWM_NUM; ++chan) if (our_chip->variant.output_mask & BIT(chan)) @@ -594,10 +592,8 @@ static int pwm_samsung_probe(struct platform_device *pdev) platform_set_drvdata(pdev, chip); ret = devm_pwmchip_add(&pdev->dev, chip); - if (ret < 0) { - dev_err(dev, "failed to register PWM chip\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "failed to register PWM chip\n"); dev_dbg(dev, "base_clk at %lu, tclk0 at %lu, tclk1 at %lu\n", clk_get_rate(our_chip->base_clk),