From patchwork Thu Sep 27 05:54:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1511691 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 42B323FDAE for ; Thu, 27 Sep 2012 05:54:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754855Ab2I0FyX (ORCPT ); Thu, 27 Sep 2012 01:54:23 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:38591 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475Ab2I0FyW (ORCPT ); Thu, 27 Sep 2012 01:54:22 -0400 Received: by mail-qc0-f174.google.com with SMTP id d3so786900qch.19 for ; Wed, 26 Sep 2012 22:54:22 -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=bZOvznANAfD9KGUjiWJsI6Y+g3ob5Hil0jyX2Qb/qko=; b=Pui3s7w0Xy4fqfntcKBeQDQU5Znydn2Cs2seYjLm9PlixzISeWTf8tmo3TkJWPFuTV tv8NdjXMm/aJj9F+IT9pQOFx5R7jip6YewHI7LdNiCgO2pfEspEagzdP4OVAwpzWvjuv pc5b0x57rir7EbDl9MlZWlprDxnyep/VhOuG1pBxRqZmz+vzuvGYI8ynkLWHRX0Au6Dn uH+2stONmuNQBrVjCJ5GJ2PY1f4qUXA1PTtkk8rCbE9LXU7MQhTlqFvsPtBiRF7OgjyZ 0WSTbwq9iy+yeLTPTw3jjfbbEoDmKJTw5+INP1vPkQRs+TfLxfXtDpApaMPK3Df0cbTA 8Glg== MIME-Version: 1.0 Received: by 10.229.136.131 with SMTP id r3mr1812653qct.145.1348725262152; Wed, 26 Sep 2012 22:54:22 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Wed, 26 Sep 2012 22:54:22 -0700 (PDT) Date: Thu, 27 Sep 2012 13:54:22 +0800 Message-ID: Subject: [PATCH] ARM: OMAP2+: SmartReflex: fix return value check in sr_dev_init() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Wei Yongjun In case of error, the function voltdm_lookup() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Acked-by: Jean Pihet --- arch/arm/mach-omap2/sr_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c index d033a65..c248b30 100644 --- a/arch/arm/mach-omap2/sr_device.c +++ b/arch/arm/mach-omap2/sr_device.c @@ -123,7 +123,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) sr_data->senp_mod = 0x1; sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name); - if (IS_ERR(sr_data->voltdm)) { + if (!sr_data->voltdm) { pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", __func__, sr_dev_attr->sensor_voltdm_name); goto exit;