From patchwork Thu Apr 30 02:06:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6299611 Return-Path: X-Original-To: patchwork-linux-spi@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 1A0B79F373 for ; Thu, 30 Apr 2015 02:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E99B20160 for ; Thu, 30 Apr 2015 02:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6548920173 for ; Thu, 30 Apr 2015 02:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbbD3CHA (ORCPT ); Wed, 29 Apr 2015 22:07:00 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:32816 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751206AbbD3CHA (ORCPT ); Wed, 29 Apr 2015 22:07:00 -0400 Received: by pdbnk13 with SMTP id nk13so45469950pdb.0 for ; Wed, 29 Apr 2015 19:06:59 -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=eaL0JGe3msc3JgCf0xS0+8UMC4hRYVGNLS7u9hW7LNg=; b=czOIpIaIZQLyltlnQggpM7eqDE0bXLRoXqCNMTYwuuWL95fv6XAEFlN2FtGqpEGNBJ XFLZ6SpkJStkLD/Fa19ml8a12kVfjGzzJ851dZI8Sfec6EVfoE+tk9n+Fn/YuS0+lETu heB8QVY21nfcyZD9ZBxMnSE+gsXFRd+uvY4jkHxJh5JhOoLe6bsPyLzHpW31NdF8fdCL TLCSDbqBOgy+MWEbZ8VthsIuVBmreBpfneU5z4uKBLsZrktsfp4xZ8k3w3kLlXdyJ6IZ YSLX8JXwJyI7+Fch0g93Bb8zMRt1JoGJ0ViL0hc091BE/C/L/PPaPseZoMxuAfrKHzJ6 zoXQ== X-Gm-Message-State: ALoCoQmFabrz3iigHBes94fQhgw/jrW/nVNnyMXW7UuYO6+DVawvv3ekR4E8G9eI0NWedpZFBTJO X-Received: by 10.70.118.73 with SMTP id kk9mr3706823pdb.150.1430359619579; Wed, 29 Apr 2015 19:06:59 -0700 (PDT) Received: from phoenix (36-229-209-5.dynamic-ip.hinet.net. [36.229.209.5]) by mx.google.com with ESMTPSA id n3sm455028pdn.67.2015.04.29.19.06.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 19:06:58 -0700 (PDT) Message-ID: <1430359614.2531.1.camel@ingics.com> Subject: [PATCH] spi: rb4xx: Fix checking return value of devm_ioremap_resource() From: Axel Lin To: Mark Brown Cc: Bert Vermeulen , linux-spi Date: Thu, 30 Apr 2015 10:06:54 +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 failure. Signed-off-by: Axel Lin --- drivers/spi/spi-rb4xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c index 50f49f3..3641d0e 100644 --- a/drivers/spi/spi-rb4xx.c +++ b/drivers/spi/spi-rb4xx.c @@ -145,7 +145,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev) r = platform_get_resource(pdev, IORESOURCE_MEM, 0); spi_base = devm_ioremap_resource(&pdev->dev, r); - if (!spi_base) + if (IS_ERR(spi_base)) return PTR_ERR(spi_base); master = spi_alloc_master(&pdev->dev, sizeof(*rbspi));