From patchwork Sat May 10 09:57:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4147571 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 7FAFE9F485 for ; Sat, 10 May 2014 09:57:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7260201BB for ; Sat, 10 May 2014 09:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D719D201D5 for ; Sat, 10 May 2014 09:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbaEJJ51 (ORCPT ); Sat, 10 May 2014 05:57:27 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:58336 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756846AbaEJJ5Z (ORCPT ); Sat, 10 May 2014 05:57:25 -0400 Received: by mail-pa0-f53.google.com with SMTP id kp14so5375265pab.26 for ; Sat, 10 May 2014 02:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sn1iotRa33Rk90FbyOmNXlFUtuvQivAnTs5ZCZGRbt4=; b=sgTXlQkdlvUIL8T/jld1HfWC79Ae3nwiL2e8buNwFux5XKnQoGXqKafl9n/TDGbeaD 9Jov1+qxud+Qf1LV4nHzyWswzZ12VdQllt/nT+ITHa+XTYjhjRymZnUlCds57MhrQVgY g9gnn2BOM9f2IWkX9+JiAx91u8wNVXl4Tp0JiHeXtHdEMOwLAedRXH8pkOyL7tl50XP8 Lo/m23uBYheGtw9bWFdNQzlVeECkes2+JlXqfS7YGQADw+ZOgTcFv4iozln42C1Gkx3K Pxjci8zFUaNPAcAAIg6ycRatWceKzdPhMg9nUHM1hupoM8e89DmO7dpKAENl6L8C7v3d 2Kfw== X-Received: by 10.67.14.69 with SMTP id fe5mr30932599pad.120.1399715845196; Sat, 10 May 2014 02:57:25 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id ox3sm11946297pbb.88.2014.05.10.02.57.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 May 2014 02:57:24 -0700 (PDT) From: Vivek Gautam To: linux-usb@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, swarren@wwwdotorg.org, kgene.kim@samsung.com, thierry.reding@gmail.com, Vivek Gautam Subject: [PATCH 3/6] usb: host: ehci-mv: Use devm_ioremap_resource instead of devm_ioremap Date: Sat, 10 May 2014 15:27:00 +0530 Message-Id: <1399715823-19839-4-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399715823-19839-1-git-send-email-gautam.vivek@samsung.com> References: <1399715823-19839-1-git-send-email-gautam.vivek@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Using devm_ioremap_resource() API should actually be preferred over devm_ioremap(), since the former request the mem region first and then gives back the ioremap'ed memory pointer. devm_ioremap_resource() calls request_mem_region(), therby preventing other drivers to make any overlapping call to the same region. Signed-off-by: Vivek Gautam --- drivers/usb/host/ehci-mv.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index bd61612..5d03787 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -176,10 +176,8 @@ static int mv_ehci_probe(struct platform_device *pdev) goto err_put_hcd; } - ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start, - resource_size(r)); + ehci_mv->phy_regs = devm_ioremap_resource(&pdev->dev, r); if (!ehci_mv->phy_regs) { - dev_err(&pdev->dev, "failed to map phy I/O memory\n"); retval = -EFAULT; goto err_put_hcd; } @@ -191,10 +189,8 @@ static int mv_ehci_probe(struct platform_device *pdev) goto err_put_hcd; } - ehci_mv->cap_regs = devm_ioremap(&pdev->dev, r->start, - resource_size(r)); + ehci_mv->cap_regs = devm_ioremap_resource(&pdev->dev, r); if (ehci_mv->cap_regs == NULL) { - dev_err(&pdev->dev, "failed to map I/O memory\n"); retval = -EFAULT; goto err_put_hcd; }