From patchwork Sat Jun 29 00:44:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2802911 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6BA2BF4A1 for ; Sat, 29 Jun 2013 00:45:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D1AE20198 for ; Sat, 29 Jun 2013 00:45:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 46BED20196 for ; Sat, 29 Jun 2013 00:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171Ab3F2Aoz (ORCPT ); Fri, 28 Jun 2013 20:44:55 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:38548 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015Ab3F2Aoy (ORCPT ); Fri, 28 Jun 2013 20:44:54 -0400 Received: by mail-bk0-f52.google.com with SMTP id d7so999883bkh.25 for ; Fri, 28 Jun 2013 17:44:53 -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=ydiUJjKxQEx81eDb2291sKKOMr+5Je9ou1vtYxVYO0w=; b=iNYh1LaUTqz5SIyNU5l2fdD7+u3yqECAZ6bzulrf/QP3cho1VHLchGAyYjZnwec9iM 3gHvtAUFr3VnaNFNehD4fWWB0d9F7gHvikkS4H19tyUOXUHSRe0PlfwWczFaGAIEFjQW nXMoZcPJc5ZBAB3a2zrW+SZC9t4QALCN+cGkOwxDZgvStwNgeeud9FcG34FuT5B5kVvA pNCyOg140xScDPl3BpSWM1BWwr0B+3B90KGz4GhHBWO7jwCltJPyYLlLWgRwtYD4WR4+ ektltOk1RY5YH2mMDm9qLiypau0CrlhFQz59dmoL937qwzTOd3UjjVzirvSRMK+bzu58 YFQw== MIME-Version: 1.0 X-Received: by 10.204.189.80 with SMTP id dd16mr2068367bkb.126.1372466693488; Fri, 28 Jun 2013 17:44:53 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Fri, 28 Jun 2013 17:44:53 -0700 (PDT) Date: Sat, 29 Jun 2013 08:44:53 +0800 Message-ID: Subject: [PATCH -next] mmc: jz4740: fix return value check in jz4740_mmc_probe() From: Wei Yongjun To: cjb@laptop.org, lars@metafoo.de, viresh.kumar@linaro.org, g.liakhovetski@gmx.de, gregkh@linuxfoundation.org Cc: yongjun_wei@trendmicro.com.cn, linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Also there is already a error message within devm_ioremap_resource(), so remove the dev_err call to avoid redundant error message. Signed-off-by: Wei Yongjun --- drivers/mmc/host/jz4740_mmc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index 0308c9f..d058f0c 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -783,9 +783,8 @@ static int jz4740_mmc_probe(struct platform_device* pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->base = devm_ioremap_resource(&pdev->dev, res); - if (!host->base) { - ret = -EBUSY; - dev_err(&pdev->dev, "Failed to ioremap base memory\n"); + if (IS_ERR(host->base)) { + ret = PTR_ERR(host->base); goto err_free_host; }