From patchwork Fri Jun 20 20:38:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4392621 Return-Path: X-Original-To: patchwork-linux-spi@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 DC8A0BEEAA for ; Fri, 20 Jun 2014 20:39:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 180FE203C4 for ; Fri, 20 Jun 2014 20:39:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA18A203B6 for ; Fri, 20 Jun 2014 20:39:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757335AbaFTUjG (ORCPT ); Fri, 20 Jun 2014 16:39:06 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:58226 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753277AbaFTUjG (ORCPT ); Fri, 20 Jun 2014 16:39:06 -0400 Received: by mail-pd0-f169.google.com with SMTP id g10so3346870pdj.14 for ; Fri, 20 Jun 2014 13:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=PfB5fJnm6/sZmsOSk8mcVV57dQmVE4py7GbbucEGgN0=; b=wl/rPmkH79W/aGlh+/S9CePNW2klz/yg+SSI8eM2xw8EqYMxkuv4tRwn2iHYN7XCc3 CIMD3H94lU2Mx3USoiu6jFZMYr8p15xVYKnP+Z/27XDITJu18qBJZLV+VxQ7r4VSuKKl t0wviUHg2P0sdmr22knwmzlybujAzUiwxuV3jCtsc3USnYoH0fNU7XdVgnymJ7etpYKN nz6ei5bPR4ym1ESL4XQWOjBbdz/w2m/atcYl7ZdnJLiKNyeUPsOW7QcVL5bIGtXLWYf4 8P+uqPvLaCeSuUvB7MDKCN0cauRXNtdibmPDqUJ57CQyVt4ZFnRUCDxS99RE81f0ZPp1 JvYQ== X-Received: by 10.68.137.33 with SMTP id qf1mr7616025pbb.99.1403296744820; Fri, 20 Jun 2014 13:39:04 -0700 (PDT) Received: from localhost ([42.104.13.132]) by mx.google.com with ESMTPSA id vy5sm48367161pac.13.2014.06.20.13.39.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 20 Jun 2014 13:39:03 -0700 (PDT) Date: Sat, 21 Jun 2014 02:08:58 +0530 From: Himangi Saraogi To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH] spi: omap-uwire: use devm_ functions Message-ID: <20140620203858.GA14718@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 This patch introduces the use of devm_clk_get and devm_ioremap instead of the unmanaged interfaces and removes the corresponding free function calls. Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- drivers/spi/spi-omap-uwire.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 0f5a0aa..cbf67f9 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -447,7 +447,6 @@ static void uwire_off(struct uwire_spi *uwire) { uwire_write_reg(UWIRE_SR3, 0); clk_disable(uwire->ck); - clk_put(uwire->ck); spi_master_put(uwire->bitbang.master); } @@ -463,7 +462,7 @@ static int uwire_probe(struct platform_device *pdev) uwire = spi_master_get_devdata(master); - uwire_base = ioremap(UWIRE_BASE_PHYS, UWIRE_IO_SIZE); + uwire_base = devm_ioremap(&pdev->dev, UWIRE_BASE_PHYS, UWIRE_IO_SIZE); if (!uwire_base) { dev_dbg(&pdev->dev, "can't ioremap UWIRE\n"); spi_master_put(master); @@ -472,12 +471,11 @@ static int uwire_probe(struct platform_device *pdev) platform_set_drvdata(pdev, uwire); - uwire->ck = clk_get(&pdev->dev, "fck"); + uwire->ck = devm_clk_get(&pdev->dev, "fck"); if (IS_ERR(uwire->ck)) { status = PTR_ERR(uwire->ck); dev_dbg(&pdev->dev, "no functional clock?\n"); spi_master_put(master); - iounmap(uwire_base); return status; } clk_enable(uwire->ck); @@ -507,7 +505,6 @@ static int uwire_probe(struct platform_device *pdev) status = spi_bitbang_start(&uwire->bitbang); if (status < 0) { uwire_off(uwire); - iounmap(uwire_base); } return status; } @@ -520,7 +517,6 @@ static int uwire_remove(struct platform_device *pdev) spi_bitbang_stop(&uwire->bitbang); uwire_off(uwire); - iounmap(uwire_base); return 0; }