From patchwork Thu Apr 16 12:19:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 6225621 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E67F9F313 for ; Thu, 16 Apr 2015 12:21:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28343202B8 for ; Thu, 16 Apr 2015 12:21:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4324520154 for ; Thu, 16 Apr 2015 12:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757294AbbDPMVb (ORCPT ); Thu, 16 Apr 2015 08:21:31 -0400 Received: from m12-16.163.com ([220.181.12.16]:34409 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754704AbbDPMVa (ORCPT ); Thu, 16 Apr 2015 08:21:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=pNl/fwEeYvq/wx6XYr wXiqtG/A4Hk8/LXbAnm2xjRf4=; b=I32WOEKQnJtKLUk3voiarXZBFZo+jqPdrz N/srZXAkWQvm2qGW2RpNW30oeVnNVsJVZNmP2D4cPcG4iPwR8P2zbA87f5+M0GbL Znu7L4nryk7HyM2si99Wm6d3qcSXt4zjRd670JtdwXa5rYDc6IrOz+GM1e8MLByE 2UQDXpdcM= Received: from localhost.localdomain.localdomain (unknown [49.77.26.90]) by smtp12 (Coremail) with SMTP id EMCowEDJiVvgqC9VebV2AQ--.51S2; Thu, 16 Apr 2015 20:19:52 +0800 (CST) X-Coremail-DSSMTP: 49.77.26.90 From: weiyj_lk@163.com To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Nicolas Ferre , Alexandre Belloni , Guenter Roeck , Maxime Ripard Cc: Wei Yongjun , linux-pm@vger.kernel.org Subject: [PATCH] power/reset: at91: fix return value check in at91_reset_platform_probe() Date: Thu, 16 Apr 2015 20:19:43 +0800 Message-Id: <1429186783-20895-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: EMCowEDJiVvgqC9VebV2AQ--.51S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4DuFWfArykKw1kuw1UAwb_yoWDZrX_u3 y5urWxA3sIgr1qkFZFvrnxAry3CasruFW8Wr1vq34aq34jgrnxJr9Fvr1kXr47Xa97uFZ0 kF9FgF43AFn3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUezpBDUUUUU== X-Originating-IP: [49.77.26.90] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbivxzd1lD+ZvdSOgAAs- Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/power/reset/at91-reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" 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/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index 13584e2..4d7d60e 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -212,9 +212,9 @@ static int at91_reset_platform_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1 ); at91_ramc_base[idx] = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (IS_ERR(at91_ramc_base[idx])) { + if (!at91_ramc_base[idx]) { dev_err(&pdev->dev, "Could not map ram controller address\n"); - return PTR_ERR(at91_ramc_base[idx]); + return -ENOMEM; } }