From patchwork Sun Dec 8 15:03:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris BREZILLON X-Patchwork-Id: 3307021 Return-Path: X-Original-To: patchwork-linux-arm@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 6101EC0D4A for ; Sun, 8 Dec 2013 15:06:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 84CA620221 for ; Sun, 8 Dec 2013 15:06:17 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C0548201F4 for ; Sun, 8 Dec 2013 15:06:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VpfvB-0002iP-VD; Sun, 08 Dec 2013 15:05:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vpfuu-0003jR-A0; Sun, 08 Dec 2013 15:05:08 +0000 Received: from 3.mo1.mail-out.ovh.net ([46.105.60.232] helo=mo1.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vpfuq-0003iC-LD for linux-arm-kernel@lists.infradead.org; Sun, 08 Dec 2013 15:05:05 +0000 Received: from mail170.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo1.mail-out.ovh.net (Postfix) with SMTP id E768FFFA22D for ; Sun, 8 Dec 2013 16:07:49 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 8 Dec 2013 17:04:42 +0200 Received: from cha74-5-78-236-240-82.fbx.proxad.net (HELO localhost.localdomain) (b.brezillon@overkiz.com@78.236.240.82) by ns0.ovh.net with SMTP; 8 Dec 2013 17:04:40 +0200 From: Boris BREZILLON To: Douglas Gilbert , Nicolas Ferre , Tomasz Figa , Alan Stern , Greg Kroah-Hartman , Sergei Shtylyov Subject: [PATCH v4 3/3] usb: ohci-at91: use device managed clk retrieval Date: Sun, 8 Dec 2013 16:03:00 +0100 Message-Id: <1386514980-6383-4-git-send-email-b.brezillon@overkiz.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1386514980-6383-1-git-send-email-b.brezillon@overkiz.com> References: <1386514980-6383-1-git-send-email-b.brezillon@overkiz.com> X-Ovh-Tracer-Id: 9976317600401684738 X-Ovh-Remote: 78.236.240.82 (cha74-5-78-236-240-82.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrkeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeiledrkeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131208_100504_887210_193C4AA9 X-CRM114-Status: GOOD ( 13.32 ) X-Spam-Score: -1.9 (-) Cc: Grant Likely , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Boris BREZILLON X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Replace clk_get calls by devm_clk_get calls. Signed-off-by: Boris BREZILLON Acked-by: Nicolas Ferre Signed-off-by: Alan Stern --- drivers/usb/host/ohci-at91.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 30f1445..9db3954 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -165,30 +165,30 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, goto err; } - iclk = clk_get(dev, "ohci_clk"); + iclk = devm_clk_get(dev, "ohci_clk"); if (IS_ERR(iclk)) { dev_err(dev, "failed to get ohci_clk\n"); retval = PTR_ERR(iclk); goto err; } - fclk = clk_get(dev, "uhpck"); + fclk = devm_clk_get(dev, "uhpck"); if (IS_ERR(fclk)) { dev_err(dev, "failed to get uhpck\n"); retval = PTR_ERR(fclk); - goto err4; + goto err; } - hclk = clk_get(dev, "hclk"); + hclk = devm_clk_get(dev, "hclk"); if (IS_ERR(hclk)) { dev_err(dev, "failed to get hclk\n"); retval = PTR_ERR(hclk); - goto err5; + goto err; } if (IS_ENABLED(CONFIG_COMMON_CLK)) { - uclk = clk_get(dev, "usb_clk"); + uclk = devm_clk_get(dev, "usb_clk"); if (IS_ERR(uclk)) { dev_err(dev, "failed to get uclk\n"); retval = PTR_ERR(uclk); - goto err6; + goto err; } } @@ -204,15 +204,6 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, /* Error handling */ at91_stop_hc(pdev); - if (IS_ENABLED(CONFIG_COMMON_CLK)) - clk_put(uclk); - err6: - clk_put(hclk); - err5: - clk_put(fclk); - err4: - clk_put(iclk); - err: usb_put_hcd(hcd); return retval; @@ -237,13 +228,6 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd, usb_remove_hcd(hcd); at91_stop_hc(pdev); usb_put_hcd(hcd); - - if (IS_ENABLED(CONFIG_COMMON_CLK)) - clk_put(uclk); - clk_put(hclk); - clk_put(fclk); - clk_put(iclk); - fclk = iclk = hclk = NULL; } /*-------------------------------------------------------------------------*/