From patchwork Tue Sep 18 01:45:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 1470191 Return-Path: X-Original-To: patchwork-linux-omap@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 8DE023FCFC for ; Tue, 18 Sep 2012 01:46:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601Ab2IRBpz (ORCPT ); Mon, 17 Sep 2012 21:45:55 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:51881 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756024Ab2IRBpx (ORCPT ); Mon, 17 Sep 2012 21:45:53 -0400 Received: by obbuo13 with SMTP id uo13so9809945obb.19 for ; Mon, 17 Sep 2012 18:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version; bh=FLOVfzhkJkhmdRIgSWcElgiujCAmD/ho7S13I52d2PM=; b=HqBDqsqgRimXuK3IMsW9oh/wKdaQ2HK0/krxJytnDZ+CoLWds1itUdpgBdWogWgbv2 RPyM/a+HJ0ImsuFKvxYm34ksQTFEWNKKdW3nqrk3gg5F2U2OBbblb8pncTOq/+jbaiNm 6DIlxKKyw9WfpSdS17r++vL2KXpZGtW957Oe/ydMDbVMQ2SFOYWASo3bb3furxV1au4t 2njem4FzXMGRKCYFZ+EMniD5SSq5VdEeCKr/awh0iJANEwEP3R8yYJtUyXPgavMubmz0 bQb3MjR3bb/VeYJJcMjn4tXw33Ns+iJJ8yXuxBIKqSBKX/ROa5I8WsFGZmQaeeFw3d8i ucAA== Received: by 10.182.85.8 with SMTP id d8mr13380705obz.70.1347932753138; Mon, 17 Sep 2012 18:45:53 -0700 (PDT) Received: from [114.39.107.123] (114-39-107-123.dynamic.hinet.net. [114.39.107.123]) by mx.google.com with ESMTPS id k8sm10296695oeh.9.2012.09.17.18.45.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 18:45:52 -0700 (PDT) Message-ID: <1347932747.6562.3.camel@phoenix> Subject: [PATCH] cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Kevin Hilman , "Rafael J. Wysocki" , linux-omap@vger.kernel.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Date: Tue, 18 Sep 2012 09:45:47 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org omap_device_get_by_hwmod_name() returns ERR_PTR on error. Signed-off-by: Axel Lin Acked-by: Kevin Hilman --- drivers/cpufreq/omap-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index 6e22f44..65f8e9a 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -266,9 +266,9 @@ static int __init omap_cpufreq_init(void) } mpu_dev = omap_device_get_by_hwmod_name("mpu"); - if (!mpu_dev) { + if (IS_ERR(mpu_dev)) { pr_warning("%s: unable to get the mpu device\n", __func__); - return -EINVAL; + return PTR_ERR(mpu_dev); } mpu_reg = regulator_get(mpu_dev, "vcc");