From: Axel Lin <axel.lin@gmail.com>
To: Thierry Reding <thierry.reding@avionic-design.de>
Cc: linux-kernel@vger.kernel.org, Stephen Warren <swarren@nvidia.com>
Subject: [PATCH] pwm: Convert pwm-tegra to use devm_clk_get()
Date: Sun, 01 Jul 2012 13:00:51 +0800 [thread overview]
Message-ID: <1341118851.8998.4.camel@phoenix> (raw)
Also return proper error in tegra_pwm_remove() if pwmchip_remove() fails.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/pwm/pwm-tegra.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 472b74e..02ce18d 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -194,7 +194,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pwm);
- pwm->clk = clk_get(&pdev->dev, NULL);
+ pwm->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pwm->clk))
return PTR_ERR(pwm->clk);
@@ -206,7 +206,6 @@ static int tegra_pwm_probe(struct platform_device *pdev)
ret = pwmchip_add(&pwm->chip);
if (ret < 0) {
dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
- clk_put(pwm->clk);
return ret;
}
@@ -233,10 +232,7 @@ static int __devexit tegra_pwm_remove(struct platform_device *pdev)
clk_disable_unprepare(pc->clk);
}
- pwmchip_remove(&pc->chip);
- clk_put(pc->clk);
-
- return 0;
+ return pwmchip_remove(&pc->chip);
}
#ifdef CONFIG_OF
--
1.7.9.5
next reply other threads:[~2012-07-01 5:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-01 5:00 Axel Lin [this message]
2012-07-02 20:46 ` [PATCH] pwm: Convert pwm-tegra to use devm_clk_get() Thierry Reding
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=1341118851.8998.4.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=swarren@nvidia.com \
--cc=thierry.reding@avionic-design.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.