From mboxrd@z Thu Jan 1 00:00:00 1970 From: Devendra Naga 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 Message-ID: <1362415968-2210-2-git-send-email-devendra.aaru@gmail.com> References: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com> Return-path: Received: from mail-pb0-f42.google.com ([209.85.160.42]:64361 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756359Ab3CDQxF (ORCPT ); Mon, 4 Mar 2013 11:53:05 -0500 Received: by mail-pb0-f42.google.com with SMTP id xb4so3201605pbc.15 for ; Mon, 04 Mar 2013 08:53:04 -0800 (PST) In-Reply-To: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Zhang Rui , linux-pm@vger.kernel.org Cc: Devendra Naga 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 --- 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