From patchwork Sat May 10 12:00:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 4147981 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 629679F485 for ; Sat, 10 May 2014 12:01:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83E8F201B4 for ; Sat, 10 May 2014 12:01:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A81C6201BB for ; Sat, 10 May 2014 12:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757354AbaEJMAq (ORCPT ); Sat, 10 May 2014 08:00:46 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:34214 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757321AbaEJMAo (ORCPT ); Sat, 10 May 2014 08:00:44 -0400 Received: by mail-pd0-f172.google.com with SMTP id g10so4826987pdj.3 for ; Sat, 10 May 2014 05:00:43 -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=+cimrKuXkHLsSum7lASFxVBKClPw7wR2XYO8OXpwW44=; b=qE71EWNds7BHPs44js5CviYjB1vqsL3e1Bf511ENmH3JzwJ6BmV582Vbsg6vCgBbYY fVq6E/e/awFeQsodpgowtetOIa887hVbIKkiiDckoHJmlRg454MYUfNi76WtuXhoPmIT oCQEQxt2mWowOXaSwnjrnECoI424BKohLLSkK4UmbpPZ2I9mv2l6l6GxRZ6eE4z1Vt1T keSjTZiJEdlBOuh9I2j1R4C0qg0MjemPUlaxOTIR9c76x3UReuU0x0QKiOUJ4M/qxNi/ 7mRELP5a14t6J4q1ldm8HITUyF3LDB53UUeTzQMcimhv0t5AsQM2OHGnWdbKGKa8J2fG B3MQ== X-Received: by 10.67.4.169 with SMTP id cf9mr31509441pad.45.1399723243300; Sat, 10 May 2014 05:00:43 -0700 (PDT) Received: from vivek-linuxpc.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id tb4sm21186685pac.45.2014.05.10.05.00.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 May 2014 05:00:42 -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, shc_work@mail.ru, Vivek Gautam Subject: [PATCH v2 6/6] usb: host: ohci-exynos: Use devm_ioremap_resource instead of devm_ioremap Date: Sat, 10 May 2014 17:30:10 +0530 Message-Id: <1399723210-21569-7-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399723210-21569-1-git-send-email-gautam.vivek@samsung.com> References: <1399723210-21569-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/ohci-exynos.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 9cf80cb..dec691d 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -120,10 +120,9 @@ skip_phy: hcd->rsrc_start = res->start; hcd->rsrc_len = resource_size(res); - hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len); - if (!hcd->regs) { - dev_err(&pdev->dev, "Failed to remap I/O memory\n"); - err = -ENOMEM; + hcd->regs = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(hcd->regs)) { + err = PTR_ERR(hcd->regs); goto fail_io; }