From patchwork Fri Sep 21 06:12:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489621 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork2.kernel.org (Postfix) with ESMTP id 1466FDF28C for ; Fri, 21 Sep 2012 06:14:10 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8L6CfHn013793; Fri, 21 Sep 2012 01:12:41 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8L6CedA005584; Fri, 21 Sep 2012 01:12:40 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Fri, 21 Sep 2012 01:12:40 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8L6CeQ9001603; Fri, 21 Sep 2012 01:12:40 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 80CD680628; Fri, 21 Sep 2012 01:12:40 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id C7E3B80627 for ; Fri, 21 Sep 2012 01:12:33 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id q8L6CXjF007183 for ; Fri, 21 Sep 2012 01:12:33 -0500 (CDT) Received: from psmtp.com (na3sys009amx171.postini.com [74.125.149.97]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id q8L6CWm0007698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 21 Sep 2012 01:12:32 -0500 Received: from mail-qc0-f173.google.com ([209.85.216.173]) (using TLSv1) by na3sys009amx171.postini.com ([74.125.148.10]) with SMTP; Fri, 21 Sep 2012 02:12:32 EDT Received: by qcab12 with SMTP id b12so2369966qca.4 for ; Thu, 20 Sep 2012 23:12:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=fwU4fSejokOaP7O5Pj9IQdY2qfcVrLTe7JQgkQQP4ag=; b=0FWL7ipWh/2gp4DbgvFM+gB5k+Y/rcdEQl6lpbZ84IiwzL3geXHc/hmfC8Zl/u69O6 5UNAW6oAFD0QJ1+9J7N6kEDjaMw0UMOD+K6t8m2Fu0xYmHqbvVZfIAF7WJCXN/Q+467L /7v8NvCbe3RGYBNqgQkjG9Vuf0WQg58QC4kHi0VrX8Fv80OxgtwgXYSubL6z2K5SzAtE 5bhnbHJfM+zOFRCfw0TRQAP3C0UDGhixanWP7BIpmze4Sv22FXHO3ves3yBtpOB6mj2B /2PYgC1l8YkIRIXjf4ffWWZua+yVIBPU0b3n5oNouiEvQPv1S66XGAAGQ3V3VnXYe8qe l6Wg== MIME-Version: 1.0 Received: by 10.224.179.7 with SMTP id bo7mr9917198qab.96.1348207951556; Thu, 20 Sep 2012 23:12:31 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:12:31 -0700 (PDT) Date: Fri, 21 Sep 2012 14:12:31 +0800 Message-ID: Subject: [PATCH] davinci: fix return value check by using IS_ERR in tnetv107x_devices_init() From: Wei Yongjun To: , , X-pstn-levels: (S:40.73603/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: , , , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Wei Yongjun In case of error, the function clk_get() returns ERR_PTR() not NULL pointer. The NULL test in the error handling should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- arch/arm/mach-davinci/devices-tnetv107x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c index 29b17f7..773ab07 100644 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ b/arch/arm/mach-davinci/devices-tnetv107x.c @@ -374,7 +374,7 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) * complete sample conversion in time. */ tsc_clk = clk_get(NULL, "sys_tsc_clk"); - if (tsc_clk) { + if (!IS_ERR(tsc_clk)) { error = clk_set_rate(tsc_clk, 5000000); WARN_ON(error < 0); clk_put(tsc_clk);