From patchwork Sun Nov 1 17:18:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 1391795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaiser.cx Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CPN795VjZz9sTD for ; Mon, 2 Nov 2020 04:18:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbgKARSj (ORCPT ); Sun, 1 Nov 2020 12:18:39 -0500 Received: from viti.kaiser.cx ([85.214.81.225]:52240 "EHLO viti.kaiser.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbgKARSj (ORCPT ); Sun, 1 Nov 2020 12:18:39 -0500 Received: from dslb-188-104-063-075.188.104.pools.vodafone-ip.de ([188.104.63.75] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kZGzv-0000Pi-3R; Sun, 01 Nov 2020 18:18:31 +0100 From: Martin Kaiser To: Krzysztof Kozlowski , Wolfram Sang , Andrzej Hajda Cc: linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 1/3] i2c: exynos5: remove duplicate error message Date: Sun, 1 Nov 2020 18:18:05 +0100 Message-Id: <20201101171807.8182-1-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201027214257.8099-1-martin@kaiser.cx> References: <20201027214257.8099-1-martin@kaiser.cx> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org platform_get_irq already prints an error message if the requested irq was not found. Don't print another message in the driver. Signed-off-by: Martin Kaiser Reviewed-by: Krzysztof Kozlowski --- changes in v2 - split the patch in three parts drivers/i2c/busses/i2c-exynos5.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index 6ce3ec03b595..c5f5fb28762d 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -779,7 +779,6 @@ static int exynos5_i2c_probe(struct platform_device *pdev) i2c->irq = ret = platform_get_irq(pdev, 0); if (ret <= 0) { - dev_err(&pdev->dev, "cannot find HS-I2C IRQ\n"); ret = -EINVAL; goto err_clk; } From patchwork Sun Nov 1 17:18:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 1391796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaiser.cx Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CPN7B0Y8Kz9sTR for ; Mon, 2 Nov 2020 04:18:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727146AbgKARSo (ORCPT ); Sun, 1 Nov 2020 12:18:44 -0500 Received: from viti.kaiser.cx ([85.214.81.225]:52312 "EHLO viti.kaiser.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727122AbgKARSn (ORCPT ); Sun, 1 Nov 2020 12:18:43 -0500 Received: from dslb-188-104-063-075.188.104.pools.vodafone-ip.de ([188.104.63.75] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kZH02-0000Pi-CM; Sun, 01 Nov 2020 18:18:38 +0100 From: Martin Kaiser To: Krzysztof Kozlowski , Wolfram Sang , Andrzej Hajda Cc: linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 2/3] i2c: exynos5: fix platform_get_irq error handling Date: Sun, 1 Nov 2020 18:18:06 +0100 Message-Id: <20201101171807.8182-2-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201101171807.8182-1-martin@kaiser.cx> References: <20201027214257.8099-1-martin@kaiser.cx> <20201101171807.8182-1-martin@kaiser.cx> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org If platform_get_irq returns an error, relay this error to the caller of the probe function. Don't change all errors to -EINVAL. This breaks the case where platform_get_irq returns -EPROBE_DEFER. Signed-off-by: Martin Kaiser Reviewed-by: Krzysztof Kozlowski --- changes in v2 - split the patch in three parts drivers/i2c/busses/i2c-exynos5.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index c5f5fb28762d..fad1c52857aa 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -778,10 +778,8 @@ static int exynos5_i2c_probe(struct platform_device *pdev) init_completion(&i2c->msg_complete); i2c->irq = ret = platform_get_irq(pdev, 0); - if (ret <= 0) { - ret = -EINVAL; + if (ret <= 0) goto err_clk; - } ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq, IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c); From patchwork Sun Nov 1 17:18:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 1391797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaiser.cx Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4CPN7K6ms5z9sTD for ; Mon, 2 Nov 2020 04:18:53 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbgKARSw (ORCPT ); Sun, 1 Nov 2020 12:18:52 -0500 Received: from viti.kaiser.cx ([85.214.81.225]:52442 "EHLO viti.kaiser.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgKARSv (ORCPT ); Sun, 1 Nov 2020 12:18:51 -0500 Received: from dslb-188-104-063-075.188.104.pools.vodafone-ip.de ([188.104.63.75] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kZH0A-0000Pi-L6; Sun, 01 Nov 2020 18:18:46 +0100 From: Martin Kaiser To: Krzysztof Kozlowski , Wolfram Sang , Andrzej Hajda Cc: linux-i2c@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 3/3] i2c: exynos5: don't check for irq 0 Date: Sun, 1 Nov 2020 18:18:07 +0100 Message-Id: <20201101171807.8182-3-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201101171807.8182-1-martin@kaiser.cx> References: <20201027214257.8099-1-martin@kaiser.cx> <20201101171807.8182-1-martin@kaiser.cx> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org platform_get_irq never returns 0. Don't check for this. Make it clear that the error path always returns a negative error code. Signed-off-by: Martin Kaiser Reviewed-by: Krzysztof Kozlowski --- changes in v2 - split the patch in three parts drivers/i2c/busses/i2c-exynos5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index fad1c52857aa..20a9881a0d6c 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -778,7 +778,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev) init_completion(&i2c->msg_complete); i2c->irq = ret = platform_get_irq(pdev, 0); - if (ret <= 0) + if (ret < 0) goto err_clk; ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,