From patchwork Thu Aug 27 20:08:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741813 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 214C413A4 for ; Thu, 27 Aug 2020 20:08:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04B2A2084C for ; Thu, 27 Aug 2020 20:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558923; bh=GsZSIjNUufzxlG+lWH52LkwmFcasCpG+/8INcx8Ulgk=; h=From:To:Cc:Subject:Date:List-ID:From; b=jGyK9wEom1P7oyLGSGwgrzOvnJWn9Ah3uiI3sKFJrmpXcMzRVYa2DY4TE1SnSjkRa AXEMPb3TQ9DhWr628opJSQUwvajyU3+rVCZ7/jGlQAk61Vh9tMVi+1tUVanM4PVqUQ udQT17PdUd8dWQg5k5G6WTCdxu/0w3suOA/zx8XE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726968AbgH0UIi (ORCPT ); Thu, 27 Aug 2020 16:08:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:55066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgH0UIg (ORCPT ); Thu, 27 Aug 2020 16:08:36 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 E478120737; Thu, 27 Aug 2020 20:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558915; bh=GsZSIjNUufzxlG+lWH52LkwmFcasCpG+/8INcx8Ulgk=; h=From:To:Cc:Subject:Date:From; b=JFu15cCTxHA3ICWzg7fOthQ1h1OSPYSyM1SxSI9hWdyq1x4YeaV5N+CubpYZktS94 8Q7t2nsnCTS0EhynQiiQsovUFqqYpzBK5ys8D4NFvKsyfzf0ixGuxlwGYNUoqQgj5E N2P+QdbAx3pIDCEyZKCvztUrIvzq4aZk3+tU6gAw= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/6] gpio: bcm-kona: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:22 +0200 Message-Id: <20200827200827.26462-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Andy Shevchenko Acked-by: Florian Fainelli --- drivers/gpio/gpio-bcm-kona.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index cf3687a7925f..1e6b427f2c4a 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c @@ -590,10 +590,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) dev_err(dev, "Couldn't determine # GPIO banks\n"); return -ENOENT; } else if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Couldn't determine GPIO banks: (%pe)\n", - ERR_PTR(ret)); - return ret; + return dev_err_probe(dev, ret, "Couldn't determine GPIO banks\n"); } kona_gpio->num_bank = ret; From patchwork Thu Aug 27 20:08:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741815 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 8BA9614F6 for ; Thu, 27 Aug 2020 20:08:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65B3720848 for ; Thu, 27 Aug 2020 20:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558924; bh=7Xgw8IUGP7VLzG8Sb+5jL0H9jR3vAdKv/vfEHwLk754=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wtZmJVEgWa6NeXxhiknpqNnyeUdPeHSFrrz6DWfKLdClRVoSUFVnLQybseBMpRDAP DTir2LGN/PbDfvuu0HgeSpCwj43WRt4KqDmTEu1kQoNj+Yc4Yo0A5+raHte/fjTpoa CO82mLOMpuU/t2taG3IStmLa/rZuk3gaTmBQ4zdo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbgH0UIo (ORCPT ); Thu, 27 Aug 2020 16:08:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:55130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgH0UIk (ORCPT ); Thu, 27 Aug 2020 16:08:40 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 395FE208C9; Thu, 27 Aug 2020 20:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558919; bh=7Xgw8IUGP7VLzG8Sb+5jL0H9jR3vAdKv/vfEHwLk754=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQxNNqeGrTZ87zvEO01q+I627AIhrSDzy8XyPOHUpTNWuvcDNzqfP0Kwkba8wPkDd 8j/Fie4cyZulrsCahbCBiqXdKHf61gmLwM9KYNur0QsqTFHAifFr/eN0YUIQSWUQTe umKg9mWDD/+Xti662qDARD2JVUCJmHyKGUblDEP8= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/6] gpio: davinci: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:23 +0200 Message-Id: <20200827200827.26462-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/gpio/gpio-davinci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 085b874db2a9..6f2138503726 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c @@ -237,12 +237,8 @@ static int davinci_gpio_probe(struct platform_device *pdev) for (i = 0; i < nirq; i++) { chips->irqs[i] = platform_get_irq(pdev, i); - if (chips->irqs[i] < 0) { - if (chips->irqs[i] != -EPROBE_DEFER) - dev_info(dev, "IRQ not populated, err = %d\n", - chips->irqs[i]); - return chips->irqs[i]; - } + if (chips->irqs[i] < 0) + return dev_err_probe(dev, chips->irqs[i], "IRQ not populated\n"); } chips->chip.label = dev_name(dev); From patchwork Thu Aug 27 20:08:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741817 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 3687814F6 for ; Thu, 27 Aug 2020 20:08:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B9C520848 for ; Thu, 27 Aug 2020 20:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558929; bh=xl8J41Jd34mayLp7JsZohH5l8Z/xyH60BLO5q6GW978=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vBaE24+oPLzV/T+CmTi2k+zjjXTSJ7WtWfC2d6q/xwpW+h+4oJ84MFJilriTNCg+w XgMZAs70UBD9aPYlfWopZhQGKcnHX6L+s5ff5WKUS6EoCdWH5Tx3VhLoR1z0iu7Lyv w9tiJeG8vRnFFFRKT6ZFRd4dVrfL3iPB4XORtN9E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbgH0UIr (ORCPT ); Thu, 27 Aug 2020 16:08:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbgH0UIo (ORCPT ); Thu, 27 Aug 2020 16:08:44 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 0D601208D5; Thu, 27 Aug 2020 20:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558923; bh=xl8J41Jd34mayLp7JsZohH5l8Z/xyH60BLO5q6GW978=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s1jCf85kf9gUWk+cboz4RbMo+kbKymOjBmvK8MSRzQSI0+0079W9y+PJ+YLap35BD ahUJl48XNuIUk5N1VIgJ2BdrDuAGr/y0ePeZgn2V2f8axn94ZrrZUTMgC3H2JrdcSn dhwJOE/tt9B2LszTiVINSYgUMi6PtILVcrkbjYo0= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/6] gpio: omap: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:24 +0200 Message-Id: <20200827200827.26462-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski Acked-by: Grygorii Strashko --- drivers/gpio/gpio-omap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 7fbe0c9e1fc1..2dc12f4addbd 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1394,10 +1394,7 @@ static int omap_gpio_probe(struct platform_device *pdev) if (bank->irq <= 0) { if (!bank->irq) bank->irq = -ENXIO; - if (bank->irq != -EPROBE_DEFER) - dev_err(dev, - "can't get irq resource ret=%d\n", bank->irq); - return bank->irq; + return dev_err_probe(dev, bank->irq, "can't get irq resource\n"); } bank->chip.parent = dev; From patchwork Thu Aug 27 20:08:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741819 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 22BD913A4 for ; Thu, 27 Aug 2020 20:08:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F26D72084C for ; Thu, 27 Aug 2020 20:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558930; bh=yKbOOPdL7+pZyGE3E1+yfNF4h5jwEHoSCybPJ3uzi8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y2YL0r5ehURdunvg5wFikKB3GBlGZw4vQscTz+FtLGRAjI/q1U+vx7FJLJrhWjBTH tjhVPo7sJ8UTvyrZZ3ZnZn32I1Y4RMhzW/gXgCE51rXbnBCFrYzjw5Ym5oK/LGIqPd qTUT7yUKun0xzQNYzHPbD1kMdkhnvI+Wt+hNuwyk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbgH0UIt (ORCPT ); Thu, 27 Aug 2020 16:08:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:55272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbgH0UIs (ORCPT ); Thu, 27 Aug 2020 16:08:48 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 48205208C9; Thu, 27 Aug 2020 20:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558927; bh=yKbOOPdL7+pZyGE3E1+yfNF4h5jwEHoSCybPJ3uzi8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6bLk4HnAq9bJHAHUxEWuDmV6GHGctBbrcdHLb+vrQWQGBE03Vl66RbLLdknLICHQ +UMLr5pmALhNjszvyPq5Ch+KLiEGYqrnKzycspwl7K06ZFaairZDo4Z2PnysttwnG0 1Tt5S/Xzw9GLXfesNCRjntPxgNca4AfPReMwD7Eo= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 4/6] gpio: pca953x: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:25 +0200 Message-Id: <20200827200827.26462-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/gpio/gpio-pca953x.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index bd2e96c34f82..b5c3e56613a7 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -1000,12 +1000,9 @@ static int pca953x_probe(struct i2c_client *client, chip->client = client; reg = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(reg)) { - ret = PTR_ERR(reg); - if (ret != -EPROBE_DEFER) - dev_err(&client->dev, "reg get err: %d\n", ret); - return ret; - } + if (IS_ERR(reg)) + return dev_err_probe(&client->dev, PTR_ERR(reg), "reg get err\n"); + ret = regulator_enable(reg); if (ret) { dev_err(&client->dev, "reg en err: %d\n", ret); From patchwork Thu Aug 27 20:08:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741821 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 EA3D814F6 for ; Thu, 27 Aug 2020 20:08:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE568208C9 for ; Thu, 27 Aug 2020 20:08:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558936; bh=HjZ45Ea8Nex20zUFNvtFaU1eRcozwjjKB1eLAew+OQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2asdwk7Qu0mIH0AJ8Sr1cYM7A7mM/wPm2R09+CVdW/vHSza9+/st7PsMV2z++jiDI pNvDPJDieENJYHGTn+SgU7vzVi9R8/Y/TwWNe7FYU5F9qa5gmGuCxBsVsgT6LUl9KM coVMdkAEmgww4c2hr/4/I2BYmLk0eI1TX8eHXGnw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbgH0UIw (ORCPT ); Thu, 27 Aug 2020 16:08:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbgH0UIw (ORCPT ); Thu, 27 Aug 2020 16:08:52 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 6543520737; Thu, 27 Aug 2020 20:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558931; bh=HjZ45Ea8Nex20zUFNvtFaU1eRcozwjjKB1eLAew+OQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCPSmc9RxrMHbIf6S8DABmPBVlWx8Ssyvwkq6fqtZgQ4sPo1puCHk3yqn4Jhj0CfV 4ut/br5MNdIKoFME0nJm9+dMCdSXmVHF8pKuMZJ+qgVlKu3KSC6Iq8q2JBSEb4+Y8W IXv0MI8WvrzwzNgPoCG63B4mZtcC0EieIcoaOhTQ= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 5/6] gpio: pisosr: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:26 +0200 Message-Id: <20200827200827.26462-5-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/gpio/gpio-pisosr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c index 6698feabaced..8e04054cf07e 100644 --- a/drivers/gpio/gpio-pisosr.c +++ b/drivers/gpio/gpio-pisosr.c @@ -148,12 +148,9 @@ static int pisosr_gpio_probe(struct spi_device *spi) return -ENOMEM; gpio->load_gpio = devm_gpiod_get_optional(dev, "load", GPIOD_OUT_LOW); - if (IS_ERR(gpio->load_gpio)) { - ret = PTR_ERR(gpio->load_gpio); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Unable to allocate load GPIO\n"); - return ret; - } + if (IS_ERR(gpio->load_gpio)) + return dev_err_probe(dev, PTR_ERR(gpio->load_gpio), + "Unable to allocate load GPIO\n"); mutex_init(&gpio->lock); From patchwork Thu Aug 27 20:08:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741823 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 03C8114F6 for ; Thu, 27 Aug 2020 20:09:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA32120848 for ; Thu, 27 Aug 2020 20:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558941; bh=jqbCUCwaNDypOtzCNXSWzew6krtWZkO/KHBOcaEh1TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=X5N8NWIavhUUQPAxuBp63Kny6MHNpcr50W0HQQltbz3waQpxZB6tL+YfiLhbb0pi+ TDvsldbG5xJ29hPFIyY2KrKLWbq2J82JEVuUa3+McTD0PVbyUiRVjxtFt1IQ7o7MeJ SREsoDYCgR0w2hhIb5ElYvtO6P7+9uBHZ4jC/T7U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727883AbgH0UI5 (ORCPT ); Thu, 27 Aug 2020 16:08:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:55438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbgH0UI4 (ORCPT ); Thu, 27 Aug 2020 16:08:56 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 2A4B6208FE; Thu, 27 Aug 2020 20:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598558935; bh=jqbCUCwaNDypOtzCNXSWzew6krtWZkO/KHBOcaEh1TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AXqlSAaruLYKES5GfoaCIjkIXBGmvuw8aRlvNYhegqHJbE3jQLVi2gliQbBq9Z3xE 6uyX65ypKowMOFwSzVDeI/hstiynecXeTy62V8G5bGMqAReK88sFO4orKu5nLw2MNK FzV7xOQPilZpKvfXFITbH6G2tnGGsah1K5NuoSBg= From: Krzysztof Kozlowski To: Ray Jui , Linus Walleij , Bartosz Golaszewski , Florian Fainelli , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Keerthy , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH 6/6] gpio: zynq: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 22:08:27 +0200 Message-Id: <20200827200827.26462-6-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827200827.26462-1-krzk@kernel.org> References: <20200827200827.26462-1-krzk@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Michal Simek --- drivers/gpio/gpio-zynq.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 53d1387592fd..0b5a17ab996f 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -929,11 +929,9 @@ static int zynq_gpio_probe(struct platform_device *pdev) /* Retrieve GPIO clock */ gpio->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(gpio->clk)) { - if (PTR_ERR(gpio->clk) != -EPROBE_DEFER) - dev_err(&pdev->dev, "input clock not found.\n"); - return PTR_ERR(gpio->clk); - } + if (IS_ERR(gpio->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(gpio->clk), "input clock not found.\n"); + ret = clk_prepare_enable(gpio->clk); if (ret) { dev_err(&pdev->dev, "Unable to enable clock.\n");