mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <stern@rowland.harvard.edu>, <kernel@wantstofly.org>,
	<gregkh@linuxfoundation.org>
Subject: [PATCH 3/4] usb: ohci-ep93xx: use devm_clk_get()
Date: Fri, 28 Jun 2013 17:29:04 -0700	[thread overview]
Message-ID: <201306281729.04871.hartleys@visionengravers.com> (raw)

Use devm_clk_get() to make the code a bit cleaner and simpler.

This also fixes a bug where a clk_put() is not done if usb_add_hcd()
fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/host/ohci-ep93xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index b4f5e64..28fa6b8 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -69,9 +69,8 @@ static int usb_hcd_ep93xx_probe(const struct hc_driver *driver,
 		goto err_put_hcd;
 	}
 
-	usb_host_clock = clk_get(&pdev->dev, NULL);
+	usb_host_clock = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(usb_host_clock)) {
-		dev_dbg(&pdev->dev, "clk_get failed\n");
 		retval = PTR_ERR(usb_host_clock);
 		goto err_put_hcd;
 	}
@@ -96,7 +95,6 @@ static void usb_hcd_ep93xx_remove(struct usb_hcd *hcd,
 {
 	usb_remove_hcd(hcd);
 	ep93xx_stop_hc(&pdev->dev);
-	clk_put(usb_host_clock);
 	usb_put_hcd(hcd);
 }
 
-- 
1.8.1.4


                 reply	other threads:[~2013-06-29  0:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201306281729.04871.hartleys@visionengravers.com \
    --to=hartleys@visionengravers.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@wantstofly.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome