From: Devendra Naga <devendra.aaru@gmail.com>
To: Zhang Rui <rui.zhang@intel.com>, linux-pm@vger.kernel.org
Cc: Devendra Naga <devendra.aaru@gmail.com>
Subject: [PATCH 2/2] thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail.
Date: Mon, 4 Mar 2013 11:52:48 -0500 [thread overview]
Message-ID: <1362415968-2210-2-git-send-email-devendra.aaru@gmail.com> (raw)
In-Reply-To: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com>
we are returning EINVAL while the thermal_zone_device_register function fail.
instead we can use the return value from the thermal_zone_device_register by
using PTR_ERR.
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
drivers/thermal/exynos_thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index e04ebd8..46568c0 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -476,7 +476,7 @@ static int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)
if (IS_ERR(th_zone->therm_dev)) {
pr_err("Failed to register thermal zone device\n");
- ret = -EINVAL;
+ ret = PTR_ERR(th_zone->therm_dev);
goto err_unregister;
}
th_zone->mode = THERMAL_DEVICE_ENABLED;
--
1.8.1.2
next prev parent reply other threads:[~2013-03-04 16:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 16:52 [PATCH 1/2] thermal: rcar_thermal: propagate return value of thermal_zone_device_register Devendra Naga
2013-03-04 16:52 ` Devendra Naga [this message]
2013-03-11 14:47 ` [PATCH 2/2] thermal: exynos_thermal: return a proper error code while thermal_zone_device_register fail Zhang Rui
2013-03-11 14:47 ` [PATCH 1/2] thermal: rcar_thermal: propagate return value of thermal_zone_device_register Zhang Rui
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=1362415968-2210-2-git-send-email-devendra.aaru@gmail.com \
--to=devendra.aaru@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.