From: Soren Brinkmann <soren.brinkmann@xilinx.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>,
Michal Simek <michal.simek@xilinx.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Soren Brinkmann <soren.brinkmann@xilinx.com>
Subject: [PATCH 01/10] tty: xuartps: Use devm_clk_get()
Date: Thu, 17 Oct 2013 14:08:04 -0700 [thread overview]
Message-ID: <1382044093-29905-2-git-send-email-soren.brinkmann@xilinx.com> (raw)
In-Reply-To: <1382044093-29905-1-git-send-email-soren.brinkmann@xilinx.com>
Use the device managed interface for clocks, simplifying error paths.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
drivers/tty/serial/xilinx_uartps.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 7e4150aa69c6..103ba8826d06 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -953,23 +953,23 @@ static int xuartps_probe(struct platform_device *pdev)
if (!xuartps_data)
return -ENOMEM;
- xuartps_data->aperclk = clk_get(&pdev->dev, "aper_clk");
+ xuartps_data->aperclk = devm_clk_get(&pdev->dev, "aper_clk");
if (IS_ERR(xuartps_data->aperclk)) {
dev_err(&pdev->dev, "aper_clk clock not found.\n");
rc = PTR_ERR(xuartps_data->aperclk);
goto err_out_free;
}
- xuartps_data->refclk = clk_get(&pdev->dev, "ref_clk");
+ xuartps_data->refclk = devm_clk_get(&pdev->dev, "ref_clk");
if (IS_ERR(xuartps_data->refclk)) {
dev_err(&pdev->dev, "ref_clk clock not found.\n");
rc = PTR_ERR(xuartps_data->refclk);
- goto err_out_clk_put_aper;
+ goto err_out_free;
}
rc = clk_prepare_enable(xuartps_data->aperclk);
if (rc) {
dev_err(&pdev->dev, "Unable to enable APER clock.\n");
- goto err_out_clk_put;
+ goto err_out_free;
}
rc = clk_prepare_enable(xuartps_data->refclk);
if (rc) {
@@ -1020,10 +1020,6 @@ err_out_clk_disable:
clk_disable_unprepare(xuartps_data->refclk);
err_out_clk_dis_aper:
clk_disable_unprepare(xuartps_data->aperclk);
-err_out_clk_put:
- clk_put(xuartps_data->refclk);
-err_out_clk_put_aper:
- clk_put(xuartps_data->aperclk);
err_out_free:
kfree(xuartps_data);
@@ -1047,8 +1043,6 @@ static int xuartps_remove(struct platform_device *pdev)
port->mapbase = 0;
clk_disable_unprepare(xuartps_data->refclk);
clk_disable_unprepare(xuartps_data->aperclk);
- clk_put(xuartps_data->refclk);
- clk_put(xuartps_data->aperclk);
kfree(xuartps_data);
return rc;
}
--
1.8.4.1
next prev parent reply other threads:[~2013-10-17 21:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 21:08 [PATCH 00/10] tty: xuartps: Update Soren Brinkmann
2013-10-17 21:08 ` Soren Brinkmann [this message]
2013-10-17 21:08 ` [PATCH 02/10] tty: xuartps: Use devm_kzalloc Soren Brinkmann
2013-10-17 21:08 ` [PATCH 03/10] tty: xuartps: Implement BREAK detection, add SYSRQ support Soren Brinkmann
2013-12-02 20:42 ` Peter Hurley
2013-10-17 21:08 ` [PATCH 04/10] tty: xuartps: Add polled mode support for xuartps Soren Brinkmann
2013-10-17 21:08 ` [PATCH 05/10] tty: xuartps: support 64 byte FIFO size Soren Brinkmann
2013-10-17 21:08 ` [PATCH 06/10] tty: xuartps: Force enable the UART in xuartps_console_write Soren Brinkmann
2013-10-17 21:08 ` [PATCH 07/10] tty: xuartps: Updating set_baud_rate() Soren Brinkmann
2013-10-17 21:08 ` [PATCH 08/10] tty: xuartps: Dynamically adjust to input frequency changes Soren Brinkmann
2013-10-17 21:08 ` [PATCH 09/10] tty: xuartps: Implement suspend/resume callbacks Soren Brinkmann
2013-10-17 21:08 ` [PATCH 10/10] tty: xuartps: Update copyright information Soren Brinkmann
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=1382044093-29905-2-git-send-email-soren.brinkmann@xilinx.com \
--to=soren.brinkmann@xilinx.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=michal.simek@xilinx.com \
/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;
as well as URLs for NNTP newsgroup(s).