From patchwork Mon Jun 17 09:16:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 2732241 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 959AE9F39E for ; Mon, 17 Jun 2013 09:31:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 073ED2029B for ; Mon, 17 Jun 2013 09:31:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6218820299 for ; Mon, 17 Jun 2013 09:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755896Ab3FQJbC (ORCPT ); Mon, 17 Jun 2013 05:31:02 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:45588 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754868Ab3FQJbB (ORCPT ); Mon, 17 Jun 2013 05:31:01 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc8so2588856pbc.32 for ; Mon, 17 Jun 2013 02:31:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=j/h+n2bCtA7vCNAPBWCMqwNQkcB7MRINEp0crN4hCkk=; b=IT5lERT5YbyT7/fTO6+6Jhs1zj9zepJpV/sVBT7v3Mwz8DH6RBbx6HeY2493Lgc27+ FHXkc9QHu5uQ4XzUGDhDWJdXFWK64hwM30jH6PTx87Ou9xvPjSiRG79KKi7vcTjzX/o9 PlC2vfLCABuPAxY6Wry1VO9klNnCkT6p5B9RIWroIO2B+hxAGOvAQESsZBNGdXSr1xx3 TfAJDzOWtJDc7Jj9UffpCKpL3eM04r9km+DgY+aIjeJBEwTs5XbGkupUQRgt+xxkM0Vo zITNjl92/To1dTiDfhyIGWKpT0kLhzpagDwogBdAKuMmJAO1g6U+6OcGSvhm11hNhuys HNgw== X-Received: by 10.66.122.68 with SMTP id lq4mr11978461pab.78.1371461460903; Mon, 17 Jun 2013 02:31:00 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id xl3sm12165282pbb.17.2013.06.17.02.30.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 02:31:00 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: thierry.reding@gmail.com, patches@linaro.org, sachin.kamat@linaro.org, linux-pci@vger.kernel.org, Bjorn Helgaas Subject: [PATCH V2 6/6] pci: mvebu: Convert to use devm_ioremap_resource Date: Mon, 17 Jun 2013 14:46:13 +0530 Message-Id: <1371460573-30004-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370864113-17895-14-git-send-email-tushar.behera@linaro.org> References: <1370864113-17895-14-git-send-email-tushar.behera@linaro.org> X-Gm-Message-State: ALoCoQn09KmzAWVAJc0vlEmKfjZ7c+JMNwOdSYha2unesSbXPzaZzv7iCfQKON5kyB96TOqT1+N8 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()") introduced devm_ioremap_resource() and deprecated the use of devm_request_and_ioremap(). While at it, modify mvebu_pcie_map_registers() to propagate error code. Signed-off-by: Tushar Behera CC: linux-pci@vger.kernel.org CC: Bjorn Helgaas Acked-by: Bjorn Helgaas Acked-by: Ezequiel Garcia A --- Changes for V2: * Return proper error code in mvebu_pcie_map_registers. drivers/pci/host/pci-mvebu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 13a633b..8fc2a82 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c @@ -750,9 +750,9 @@ mvebu_pcie_map_registers(struct platform_device *pdev, ret = of_address_to_resource(np, 0, ®s); if (ret) - return NULL; + return ERR_PTR(ret); - return devm_request_and_ioremap(&pdev->dev, ®s); + return devm_ioremap_resource(&pdev->dev, ®s); } static int __init mvebu_pcie_probe(struct platform_device *pdev) @@ -842,9 +842,10 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev) continue; port->base = mvebu_pcie_map_registers(pdev, child, port); - if (!port->base) { + if (IS_ERR(port->base)) { dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n", port->port, port->lane); + port->base = NULL; continue; }