From patchwork Tue Oct 21 10:05:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varka Bhadram X-Patchwork-Id: 5112481 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07B77C11AC for ; Tue, 21 Oct 2014 10:09:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3028920122 for ; Tue, 21 Oct 2014 10:09:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5547D20138 for ; Tue, 21 Oct 2014 10:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbaJUKJM (ORCPT ); Tue, 21 Oct 2014 06:09:12 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:41240 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbaJUKJJ (ORCPT ); Tue, 21 Oct 2014 06:09:09 -0400 Received: by mail-pd0-f169.google.com with SMTP id w10so1050943pde.14 for ; Tue, 21 Oct 2014 03:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lsa1p8LFq7yPWmCCSGnqWBj6EwQTIBF+9ziOOYc4VCY=; b=gbag/5TnatIRE2qyy8Tkta/bpck2Oh1IyKs7Ni9/pWixSyiOrAcFsUmZoSxpQx2+Pi k6ptQTc1FA9YMiF0uxYltg/qEjHWdqMunDNMfEPBdwQ+1f7bY1vlhnFmc0USnzQxQqO8 wJGiqilSmCnK3pKRnrjo8jvt4PFny5gMLZDVfYjMptm3+shWE3LzFvugV+RFQXru6zzi Ox3u1opYQGj2NmwIHpssg1os4lpZnX4bPqrvccpONg5Vh1mI/lPN0URGyO8dUOZwCRf9 XlYLEXdr4+DPBrGLiOOD8j8/16aDvtFAAAAbK4/BjqE8Fyh1IGEoAY1NnvLPwRMUZmik bCtA== X-Received: by 10.70.88.202 with SMTP id bi10mr14762510pdb.119.1413886149423; Tue, 21 Oct 2014 03:09:09 -0700 (PDT) Received: from cdac.hyderabad.cdac.in ([196.12.45.164]) by mx.google.com with ESMTPSA id oq10sm2261763pac.47.2014.10.21.03.09.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 03:09:07 -0700 (PDT) From: Varka Bhadram X-Google-Original-From: Varka Bhadram To: linux-spi@vger.kernel.org Cc: Varka Bhadram Subject: [PATCH spi 5/7] spi-omap2-mcspi: remove duplicate check on resource Date: Tue, 21 Oct 2014 15:35:48 +0530 Message-Id: <1413885950-24208-5-git-send-email-varkab@cdac.in> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1413885950-24208-1-git-send-email-varkab@cdac.in> References: <1413885950-24208-1-git-send-email-varkab@cdac.in> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-8.2 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 Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram --- drivers/spi/spi-omap2-mcspi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 893c3d7..305c649 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1213,8 +1213,9 @@ static int omap2_mcspi_probe(struct platform_device *pdev) regs_offset = pdata->regs_offset; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) { - status = -ENODEV; + mcspi->base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(mcspi->base)) { + status = PTR_ERR(mcspi->base); goto free_master; } @@ -1222,12 +1223,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev) r->end += regs_offset; mcspi->phys = r->start; - mcspi->base = devm_ioremap_resource(&pdev->dev, r); - if (IS_ERR(mcspi->base)) { - status = PTR_ERR(mcspi->base); - goto free_master; - } - mcspi->dev = &pdev->dev; INIT_LIST_HEAD(&mcspi->ctx.cs);