From patchwork Tue Mar 12 15:42:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2257021 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0B992DFE75 for ; Tue, 12 Mar 2013 15:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932155Ab3CLPqm (ORCPT ); Tue, 12 Mar 2013 11:46:42 -0400 Received: from mail-ia0-f175.google.com ([209.85.210.175]:59449 "EHLO mail-ia0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932870Ab3CLPm2 (ORCPT ); Tue, 12 Mar 2013 11:42:28 -0400 Received: by mail-ia0-f175.google.com with SMTP id y26so845674iab.20 for ; Tue, 12 Mar 2013 08:42:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version:x-gm-message-state; bh=7Z+Agw/wQ+O9kXFN7a2Q10rcs087YQFv4renY+XCoeA=; b=TwERFNdxolCD4VYsDTo7/3k3CKZoglhOEx25LqCtTV6mim1aMdsp+5MRWCiqAUsxPX vlDXC875bIfSpIuivCBGvElBwUwQviOjUUKFL7mLPZJyizuCQt2q+JafNoa38pxTTLF/ Kpi2LppOSyfMI1W2EwoAps9whr5gV608ALN2Et/GioARVjexFOM7jZF1Rwe7eTXVDKcV A54vCQkRxjxEObieWhxQWA0teUgIK5LkvXExc2r53Zw8ldNtJlMU68CY2CiGQFrTS6Qf 8XsJ7VpmlNXJ7/lMLmsKJKDBjrxhZDVZfjkfNOxAo7tETTgT3ZAaUaS68ptzVaZjloMA YOBw== X-Received: by 10.50.45.136 with SMTP id n8mr12331237igm.34.1363102947333; Tue, 12 Mar 2013 08:42:27 -0700 (PDT) Received: from [192.168.0.102] (114-39-104-58.dynamic.hinet.net. [114.39.104.58]) by mx.google.com with ESMTPS id ip2sm20188511igc.5.2013.03.12.08.42.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Mar 2013 08:42:26 -0700 (PDT) Message-ID: <1363102940.3160.2.camel@phoenix> Subject: [PATCH 1/2] thermal: db8500: Fix checking return value of thermal_zone_device_register From: Axel Lin To: Zhang Rui Cc: Hongbo Zhang , Viresh Kumar , Francesco Lavra , linux-pm@vger.kernel.org Date: Tue, 12 Mar 2013 23:42:20 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQmQU7biWhe6XkAPOLenl0APE0nIn37rbuqUGxsFBjq1xq/vPvx0YRNs8ytZkuTMVroAQ52w Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org thermal_zone_device_register() returns ERR_PTR on error, thus use IS_ERR rather than IS_ERR_OR_NULL to check return value. Signed-off-by: Axel Lin --- drivers/thermal/db8500_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c index 61ce60a..6bdcec4 100644 --- a/drivers/thermal/db8500_thermal.c +++ b/drivers/thermal/db8500_thermal.c @@ -447,7 +447,7 @@ static int db8500_thermal_probe(struct platform_device *pdev) pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone", ptrips->num_trips, 0, pzone, &thdev_ops, NULL, 0, 0); - if (IS_ERR_OR_NULL(pzone->therm_dev)) { + if (IS_ERR(pzone->therm_dev)) { dev_err(&pdev->dev, "Register thermal zone device failed.\n"); return PTR_ERR(pzone->therm_dev); }