From patchwork Sat May 10 09:57:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4147641 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 12A909F23C for ; Sat, 10 May 2014 09:58:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40223201D3 for ; Sat, 10 May 2014 09:58:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70516201BB for ; Sat, 10 May 2014 09:58:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757193AbaEJJ5c (ORCPT ); Sat, 10 May 2014 05:57:32 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:51145 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756846AbaEJJ53 (ORCPT ); Sat, 10 May 2014 05:57:29 -0400 Received: by mail-pa0-f54.google.com with SMTP id bj1so4122854pad.41 for ; Sat, 10 May 2014 02:57:29 -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=0k/0yoXWjb257yjXZJWxUBbf12Pu2KZMBo14dSoiBNE=; b=gqWN6nGn9OJu8wnSGVE88wLmFz0r/T1QobxE35e4ZfPZTJSCDf1ld59nwhtgfbxJSn KlQD/WA3v+tHqBcEcXDsaI3by+9lvaf6W+LhgwROzHwu56Obonmrte2ARxT6+gwFK0e9 p79pekKUM9mb+BwIgeWDw3QCtMTYCE1cjISdkWEMJdCkXp0GNL1AyFeutS1DMBW18xlz TRcWD2Bed/LQ/J4/OHRDKzrf+kP5BisrdEzwsXzr/K4GIP//09SHJvZPZyPNTW1oYQ66 sZwkaGQw+5qGj1XJDPwpZ2QqSo0dS1gq5T08VMJyADXmPWr7P/fCGRopYtPe/F9yCDUS f0FA== X-Received: by 10.66.244.176 with SMTP id xh16mr30840156pac.20.1399715849269; Sat, 10 May 2014 02:57:29 -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.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 May 2014 02:57:28 -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 4/6] usb: host: ehci-spear: Use devm_ioremap_resource instead of devm_ioremap Date: Sat, 10 May 2014 15:27:01 +0530 Message-Id: <1399715823-19839-5-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-spear.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 8bd915b..6d84cf2 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -106,15 +106,8 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); - if (!devm_request_mem_region(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len, - driver->description)) { - retval = -EBUSY; - goto err_put_hcd; - } - - hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len); + hcd->regs = devm_ioremap_resource(&pdev->dev, res); if (hcd->regs == NULL) { - dev_dbg(&pdev->dev, "error mapping memory\n"); retval = -ENOMEM; goto err_put_hcd; }