Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753292AbdGCL7J (ORCPT ); Mon, 3 Jul 2017 07:59:09 -0400 Received: from gateway30.websitewelcome.com ([192.185.145.3]:30983 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbdGCL7I (ORCPT ); Mon, 3 Jul 2017 07:59:08 -0400 Date: Mon, 03 Jul 2017 06:59:05 -0500 Message-ID: <20170703065905.Horde.JGioNMGT4RgQsy5ykZpOZQ1@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Jon Hunter Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Thierry Reding , linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] devfreq: tegra: fix error code in tegra_devfreq_probe() References: <20170630072211.GA21867@embeddedgus> <89de541e-355e-e79c-0090-cffefd277b4c@nvidia.com> In-Reply-To: <89de541e-355e-e79c-0090-cffefd277b4c@nvidia.com> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Exim-ID: 1dS00P-000i8S-6E X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:50127 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 1 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 55 Hi Jon, Quoting Jon Hunter : > On 30/06/17 08:22, Gustavo A. R. Silva wrote: >> Print and propagate the return value of platform_get_irq on failure. >> >> Signed-off-by: Gustavo A. R. Silva >> --- >> drivers/devfreq/tegra-devfreq.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/devfreq/tegra-devfreq.c >> b/drivers/devfreq/tegra-devfreq.c >> index 214fff9..ae71215 100644 >> --- a/drivers/devfreq/tegra-devfreq.c >> +++ b/drivers/devfreq/tegra-devfreq.c >> @@ -688,9 +688,9 @@ static int tegra_devfreq_probe(struct >> platform_device *pdev) >> } >> >> irq = platform_get_irq(pdev, 0); >> - if (irq <= 0) { >> - dev_err(&pdev->dev, "Failed to get IRQ\n"); >> - return -ENODEV; >> + if (irq < 0) { > > The changelog does not describe the above change and if/why this is ok. > However, the original test looks fine to me and so I don't see a need to > change this. > You are right about the changelog. I think this one is much better: platform_get_irq() returns an error code, but the tegra-devfreq driver ignores it and always returns -ENODEV. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print error message and propagate the return value of platform_get_irq on failure. What do you think? Thank you! -- Gustavo A. R. Silva