From patchwork Tue Jun 17 15:14:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 4367231 Return-Path: X-Original-To: patchwork-linux-sh@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 DA67EBEEAA for ; Tue, 17 Jun 2014 15:15:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0BC4202AE for ; Tue, 17 Jun 2014 15:15:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3230201C8 for ; Tue, 17 Jun 2014 15:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933246AbaFQPPZ (ORCPT ); Tue, 17 Jun 2014 11:15:25 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:42508 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933221AbaFQPPY (ORCPT ); Tue, 17 Jun 2014 11:15:24 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id CD42047A682; Tue, 17 Jun 2014 16:15:23 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2uT1xoQ3nFiv; Tue, 17 Jun 2014 16:15:13 +0100 (BST) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.179]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 56F2A47A673; Tue, 17 Jun 2014 16:15:03 +0100 (BST) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1Wwv6F-0002t6-3R; Tue, 17 Jun 2014 16:15:03 +0100 From: Ben Dooks To: linux-usb@vger.kernel.org Cc: balbi@ti.com, gregkh@linuxfoundation.org, linux-sh@vger.kernel.org, Ben Dooks Subject: [PATCH 1/8] r8a66597-udc: use devm_request_and_ioremap() for registers Date: Tue, 17 Jun 2014 16:14:54 +0100 Message-Id: <1403018101-11062-2-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403018101-11062-1-git-send-email-ben.dooks@codethink.co.uk> References: <1403018101-11062-1-git-send-email-ben.dooks@codethink.co.uk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 --- drivers/usb/gadget/r8a66597-udc.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index aff0a67..7f3af74 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -1826,7 +1826,6 @@ static int __exit r8a66597_remove(struct platform_device *pdev) usb_del_gadget_udc(&r8a66597->gadget); del_timer_sync(&r8a66597->timer); - iounmap(r8a66597->reg); if (r8a66597->pdata->sudmac) iounmap(r8a66597->sudmac_reg); free_irq(platform_get_irq(pdev, 0), r8a66597); @@ -1877,11 +1876,9 @@ static int __init r8a66597_probe(struct platform_device *pdev) unsigned long irq_trigger; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - ret = -ENODEV; - dev_err(&pdev->dev, "platform_get_resource error.\n"); - goto clean_up; - } + reg = devm_ioremap_resource(&pdev->dev, res); + if (!reg) + return -ENODEV; ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq = ires->start; @@ -1893,13 +1890,6 @@ static int __init r8a66597_probe(struct platform_device *pdev) goto clean_up; } - reg = ioremap(res->start, resource_size(res)); - if (reg == NULL) { - ret = -ENOMEM; - dev_err(&pdev->dev, "ioremap error.\n"); - goto clean_up; - } - /* initialize ucd */ r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL); if (r8a66597 == NULL) { @@ -2008,8 +1998,6 @@ clean_up: r8a66597->ep0_req); kfree(r8a66597); } - if (reg) - iounmap(reg); return ret; }