From patchwork Mon Mar 4 16:52:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devendra Naga X-Patchwork-Id: 2213421 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EE96D3FCF2 for ; Mon, 4 Mar 2013 16:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757474Ab3CDQxF (ORCPT ); Mon, 4 Mar 2013 11:53:05 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Bhmob+KJhy68DNm7ja6R4976t4tIU7bR1TMIRu3zOBc=; b=XRN78FnENVhGIYCOu0qGE577yWm4XwBwGIL8tlcspJ02yNDqQ0xDAOCxxkblQtjR+X r5lrJBoylcLgk0EgjDFN1kYo+LLAec3BpxZRNvoQj+mT+lf04LkcdktkJOSWQs4AMV0V 4Ird2rDQx7x2gyNK7WB8f/70MonceNxzuizpo0LpZUZJ43Bdnuth3l9HljiwK6hqsYMT gD0XblFKlO54Km5aCbaigAp5fltErneWDohT1JjWiHSnVVZZdw/ZunLt/ikkjuxvxGEC 86VOfSqDI+pv9zwSrdTsNAxLiaFfS/gqiYlNP640ZeYaqvNlPQoUk7PZIzOP3CUipbvV TCPg== X-Received: by 10.68.234.100 with SMTP id ud4mr28841028pbc.8.1362415984003; Mon, 04 Mar 2013 08:53:04 -0800 (PST) Received: from localhost.localdomain ([122.172.43.199]) by mx.google.com with ESMTPS id gf6sm22890729pbc.24.2013.03.04.08.53.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Mar 2013 08:53:02 -0800 (PST) From: Devendra Naga To: Zhang Rui , linux-pm@vger.kernel.org Cc: 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> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com> References: <1362415968-2210-1-git-send-email-devendra.aaru@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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;