From patchwork Sun Aug 30 10:35:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 7097161 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D237BEEC1 for ; Sun, 30 Aug 2015 10:35:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 842692069B for ; Sun, 30 Aug 2015 10:35:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A561D20718 for ; Sun, 30 Aug 2015 10:35:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbbH3Kf4 (ORCPT ); Sun, 30 Aug 2015 06:35:56 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34184 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753219AbbH3Kfz (ORCPT ); Sun, 30 Aug 2015 06:35:55 -0400 Received: by pabzx8 with SMTP id zx8so108050313pab.1 for ; Sun, 30 Aug 2015 03:35:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=/uR4nZhNFrIjPIJ+xW70u4MGilajkTRDSV49E6EZc+E=; b=IXx/G2osvCxETzjQJC5tyRTFqtbE7vH8Q/RcKlotSmhrxUQu3tMhrvr0GWU/DPIGL0 fkjWXsgXwnWUv63jRlylq0fYwHzd+n7oD9S00ERizB7e538FtuwUCYXuYNsb2qrja+5C 72BVaZ6j4Gk+YGXl6Kp25icxL0hVV+5YUdio13r8IY8W+oB0gBrzVD1NuNFbr8S8jmgO fQdkCTmTY9B4FpQLdMyeCI0n5YZi6Zc6brEo7/opKZUvT0c/rXOkXp/UKv/ugvjdMtBx sM+u5yUfRyMjwLooaZIQ7uoaqdwkQRXYeCKuM1eZT0fH1coGFpCY5rDfQ+Ze+cpG5r2J RdCQ== X-Gm-Message-State: ALoCoQnitK2a8K3wx5KJiiUCR2KKwea+yaEutkm3nUEQlUNk2Cy3LibVN3ECEZj1ZUMG+FmJx3AP X-Received: by 10.66.182.161 with SMTP id ef1mr28615166pac.97.1440930955033; Sun, 30 Aug 2015 03:35:55 -0700 (PDT) Received: from phoenix.local (36-239-228-232.dynamic-ip.hinet.net. [36.239.228.232]) by smtp.gmail.com with ESMTPSA id bz1sm10926080pbb.85.2015.08.30.03.35.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 03:35:54 -0700 (PDT) Message-ID: <1440930951.24276.1.camel@ingics.com> Subject: [PATCH] spi: fsl-(e)spi: Fix checking return value of devm_ioremap_resource From: Axel Lin To: Mark Brown Cc: Heiner Kallweit , linux-spi@vger.kernel.org Date: Sun, 30 Aug 2015 18:35:51 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 devm_ioremap_resource() returns ERR_PTR on error. Signed-off-by: Axel Lin --- drivers/spi/spi-fsl-espi.c | 4 ++-- drivers/spi/spi-fsl-spi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index db82c87..c27124a 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -674,8 +674,8 @@ static struct spi_master * fsl_espi_probe(struct device *dev, mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem); - if (!mpc8xxx_spi->reg_base) { - ret = -ENOMEM; + if (IS_ERR(mpc8xxx_spi->reg_base)) { + ret = PTR_ERR(mpc8xxx_spi->reg_base); goto err_probe; } diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 17a9a87..8b290d9 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -633,8 +633,8 @@ static struct spi_master * fsl_spi_probe(struct device *dev, goto err_cpm_init; mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem); - if (mpc8xxx_spi->reg_base == NULL) { - ret = -ENOMEM; + if (IS_ERR(mpc8xxx_spi->reg_base)) { + ret = PTR_ERR(mpc8xxx_spi->reg_base); goto err_probe; }