From patchwork Tue Sep 1 15:31:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11749119 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FB07109A for ; Tue, 1 Sep 2020 16:29:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03FE5206EF for ; Tue, 1 Sep 2020 16:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598977785; bh=bXz4Z+ByU7oLOWvqxgR/MMJbU7okBrsVzpWrJCsFcyk=; h=From:To:Cc:Subject:Date:List-ID:From; b=gK3YFH+YThI0tsUMGeFt2wIzcSi8j2XW3MjZLCmhzOsijsJbvWuvunzR9SGju53RX TgrLzK8vLHJAis8nEEX1bYEeYmGWQfv3wm4aEaz4v0fMLhnVvo44AnAnFEmPvB9Op1 5Cc+ZvBU/lBsoZs+X4Zsy5zdmeU6ZktCOkr49d/g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730936AbgIAQ3h (ORCPT ); Tue, 1 Sep 2020 12:29:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:35362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730819AbgIAPb6 (ORCPT ); Tue, 1 Sep 2020 11:31:58 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F80A20E65; Tue, 1 Sep 2020 15:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974317; bh=bXz4Z+ByU7oLOWvqxgR/MMJbU7okBrsVzpWrJCsFcyk=; h=From:To:Cc:Subject:Date:From; b=rKajFz0q4YCyOZCMCE7m2QIBuiozPTmdTA+2K5aHi+owEMvuqVBp0B5msIX5bc0oK UbNS0RPWU6SHmmGVD4SwdJ65jalKFts9UsRsQEKawEeF1FC/zPL49ALinycOnl9049 UMF+1AHLFAGf3yA9IAZCf4/dtkv7gSqFc8I5iYT0= From: Krzysztof Kozlowski To: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/3] watchdog: cadence: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:31:39 +0200 Message-Id: <20200901153141.18960-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck --- drivers/watchdog/cadence_wdt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c index 672b184da875..bc99e9164930 100644 --- a/drivers/watchdog/cadence_wdt.c +++ b/drivers/watchdog/cadence_wdt.c @@ -334,12 +334,9 @@ static int cdns_wdt_probe(struct platform_device *pdev) watchdog_set_drvdata(cdns_wdt_device, wdt); wdt->clk = devm_clk_get(dev, NULL); - if (IS_ERR(wdt->clk)) { - ret = PTR_ERR(wdt->clk); - if (ret != -EPROBE_DEFER) - dev_err(dev, "input clock not found\n"); - return ret; - } + if (IS_ERR(wdt->clk)) + return dev_err_probe(dev, PTR_ERR(wdt->clk), + "input clock not found\n"); ret = clk_prepare_enable(wdt->clk); if (ret) { From patchwork Tue Sep 1 15:31:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11749117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FFC5109A for ; Tue, 1 Sep 2020 16:29:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AA3520E65 for ; Tue, 1 Sep 2020 16:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598977773; bh=2TOcs6pEYZ/R2ZwIOWWycu5Eesv8Cv5fL5GCe6HBCDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=v7Od9ZrC8cP7cY1wdI6irFEBJwPX7fAKkJo9iSCLT5b/XutkUGE5MmHY8Q67ZSqAG teW5X3bmes2X+Ertn/edpvWmLlwfwqcc5rFKRGQc5UHanq1FeVzlDnPhrm1npmH8SD 6MVeuxuHYRCDQAQNsILGo9TdLmJ2J6l3WkVevtgI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730919AbgIAQ3F (ORCPT ); Tue, 1 Sep 2020 12:29:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:35428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730828AbgIAPb7 (ORCPT ); Tue, 1 Sep 2020 11:31:59 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 473702158C; Tue, 1 Sep 2020 15:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974319; bh=2TOcs6pEYZ/R2ZwIOWWycu5Eesv8Cv5fL5GCe6HBCDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O4OLORC3rltkj827+yJajf2QcHJtT2oxnZTQsXi20OKUSQHgCT+wj0aGLff3EXq8i nEtnJJJa63q1o7Dh3ts6vf1NyQn+wMbbX2s3okILwikBh4T+1xFOKTcxCDVWp69XFe iaF2jvzo7AN1Rq3uyWHZ/QXW/iMUcTnYKzbB4/dw= From: Krzysztof Kozlowski To: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/3] watchdog: davinci: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:31:40 +0200 Message-Id: <20200901153141.18960-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901153141.18960-1-krzk@kernel.org> References: <20200901153141.18960-1-krzk@kernel.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck --- drivers/watchdog/davinci_wdt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 2b3f3cd382ef..e6eaba6bae5b 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -206,12 +206,9 @@ static int davinci_wdt_probe(struct platform_device *pdev) return -ENOMEM; davinci_wdt->clk = devm_clk_get(dev, NULL); - - if (IS_ERR(davinci_wdt->clk)) { - if (PTR_ERR(davinci_wdt->clk) != -EPROBE_DEFER) - dev_err(dev, "failed to get clock node\n"); - return PTR_ERR(davinci_wdt->clk); - } + if (IS_ERR(davinci_wdt->clk)) + return dev_err_probe(dev, PTR_ERR(davinci_wdt->clk), + "failed to get clock node\n"); ret = clk_prepare_enable(davinci_wdt->clk); if (ret) { From patchwork Tue Sep 1 15:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11749085 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A118109A for ; Tue, 1 Sep 2020 16:28:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6187620E65 for ; Tue, 1 Sep 2020 16:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598977705; bh=Z6vnP4+NxuzEHN1LLXN7z5Otdl9HCbvEaUVhEApV3pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KpdRIFXDz+sa9mFIsPoZophSfpYZAkI3RA3Pfo1+wbFP3tBgCDXWawt0DG9LiHzpa h7pg7hRWKByXh215cAhZbN2WEHx2PGfi/GLhy6j65XWIiZCpm2vleNHStNbtUto/I9 UF260C9N9AYwy4TmHZDtpTkKewK2YX75hLSRf5ZM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730853AbgIAQ2N (ORCPT ); Tue, 1 Sep 2020 12:28:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:35476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730839AbgIAPcC (ORCPT ); Tue, 1 Sep 2020 11:32:02 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0CFDE21534; Tue, 1 Sep 2020 15:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974321; bh=Z6vnP4+NxuzEHN1LLXN7z5Otdl9HCbvEaUVhEApV3pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fqfwr9EqXMJY4AgjS+slX8K8xlMBvRbd+HmV4+PYX+k3DPTRiHQzKD0eBs56sZE7A aIedGo2IgSlRBYGfqJi7P2C2/LPQXJxSrsEj9zf2ve0IMfwybZQd5GmZkp9veQR5L4 w+pUzcHh1PSH3V+dy3zb0o3wKEmrrLsQksATYFXA= From: Krzysztof Kozlowski To: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/3] watchdog: rti: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:31:41 +0200 Message-Id: <20200901153141.18960-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901153141.18960-1-krzk@kernel.org> References: <20200901153141.18960-1-krzk@kernel.org> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck --- It is unusual to expect deferred probe from pm_runtime_get()... --- drivers/watchdog/rti_wdt.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index 705e8f7523e8..836319cbaca9 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -205,11 +205,8 @@ static int rti_wdt_probe(struct platform_device *pdev) return -ENOMEM; clk = clk_get(dev, NULL); - if (IS_ERR(clk)) { - if (PTR_ERR(clk) != -EPROBE_DEFER) - dev_err(dev, "failed to get clock\n"); - return PTR_ERR(clk); - } + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), "failed to get clock\n"); wdt->freq = clk_get_rate(clk); @@ -230,11 +227,8 @@ static int rti_wdt_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "runtime pm failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "runtime pm failed\n"); platform_set_drvdata(pdev, wdt);