From: Zhang Rui <rui.zhang@intel.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
Eduardo Valentin <edubezval@gmail.com>,
Heiko Stuebner <heiko@sntech.de>
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: rockchip: fix error return code in rockchip_thermal_probe()
Date: Fri, 11 Aug 2017 11:08:27 +0800 [thread overview]
Message-ID: <1502420907.2598.9.camel@intel.com> (raw)
In-Reply-To: <20170808043517.GA13356@embeddedgus>
On Mon, 2017-08-07 at 23:35 -0500, Gustavo A. R. Silva wrote:
> platform_get_irq() returns an error code, but the rockchip_thermal
> driver
> ignores it and always returns -EINVAL. 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/co
> mmit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af
>
> Print and propagate the return value of platform_get_irq on failure.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied.
thanks,
rui
> ---
> drivers/thermal/rockchip_thermal.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c
> b/drivers/thermal/rockchip_thermal.c
> index 4c77965..6ca9747 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -1068,8 +1068,8 @@ static int rockchip_thermal_probe(struct
> platform_device *pdev)
>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0) {
> - dev_err(&pdev->dev, "no irq resource?\n");
> - return -EINVAL;
> + dev_err(&pdev->dev, "no irq resource: %d\n", irq);
> + return irq;
> }
>
> thermal = devm_kzalloc(&pdev->dev, sizeof(struct
> rockchip_thermal_data),
prev parent reply other threads:[~2017-08-11 3:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 4:35 [PATCH] thermal: rockchip: fix error return code in rockchip_thermal_probe() Gustavo A. R. Silva
2017-08-11 3:08 ` Zhang Rui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502420907.2598.9.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=edubezval@gmail.com \
--cc=gustavo@embeddedor.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).