summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-jz4740.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-27 20:15:51 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-27 20:15:51 +0400
commit398b60a8de46adfbd43aa4c01753acf0161ec764 (patch)
tree7d3a1673f4c764782cec34523967b386bf085fc6 /drivers/pwm/pwm-jz4740.c
parent028e219eff45ce8ba962c59e3dbc622499e88d50 (diff)
parent6691a19966f04dd81e60505f9630c1a7cf148507 (diff)
downloadlinux-398b60a8de46adfbd43aa4c01753acf0161ec764.tar.xz
Merge tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm
Pull pwm changes from Thierry Reding: "The patches for this release cycle include various enhancements (device tree support, better compile coverage, ...) for existing drivers. There is a new driver for Atmel SoCs. Various drivers as well as the sysfs support received minor fixes and cleanups" * tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: tiecap: Remove duplicate put_sync call pwm: tiehrpwm: use dev_err() instead of pr_err() pwm: pxa: remove unnecessary space before tabs pwm: ep93xx: split module author names pwm: use seq_puts() instead of seq_printf() pwm: atmel-pwm: Do not unprepare clock after successful registration of: Add Atmel PWM controller device tree binding pwm: atmel-pwm: Add Atmel PWM controller driver backlight: pwm_bl: Remove error message upon devm_kzalloc() failure pwm: pca9685: depends on I2C rather than REGMAP_I2C pwm: renesas-tpu: Enable driver compilation with COMPILE_TEST pwm: jz4740: Use devm_clk_get() pwm: jz4740: Pass device to clk_get() pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro pwm: pxa: Add device tree support
Diffstat (limited to 'drivers/pwm/pwm-jz4740.c')
-rw-r--r--drivers/pwm/pwm-jz4740.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/pwm/pwm-jz4740.c b/drivers/pwm/pwm-jz4740.c
index 0a2ede3c3932..9c46209e1d02 100644
--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -165,13 +165,12 @@ static const struct pwm_ops jz4740_pwm_ops = {
static int jz4740_pwm_probe(struct platform_device *pdev)
{
struct jz4740_pwm_chip *jz4740;
- int ret;
jz4740 = devm_kzalloc(&pdev->dev, sizeof(*jz4740), GFP_KERNEL);
if (!jz4740)
return -ENOMEM;
- jz4740->clk = clk_get(NULL, "ext");
+ jz4740->clk = devm_clk_get(&pdev->dev, "ext");
if (IS_ERR(jz4740->clk))
return PTR_ERR(jz4740->clk);
@@ -180,29 +179,16 @@ static int jz4740_pwm_probe(struct platform_device *pdev)
jz4740->chip.npwm = NUM_PWM;
jz4740->chip.base = -1;
- ret = pwmchip_add(&jz4740->chip);
- if (ret < 0) {
- clk_put(jz4740->clk);
- return ret;
- }
-
platform_set_drvdata(pdev, jz4740);
- return 0;
+ return pwmchip_add(&jz4740->chip);
}
static int jz4740_pwm_remove(struct platform_device *pdev)
{
struct jz4740_pwm_chip *jz4740 = platform_get_drvdata(pdev);
- int ret;
-
- ret = pwmchip_remove(&jz4740->chip);
- if (ret < 0)
- return ret;
- clk_put(jz4740->clk);
-
- return 0;
+ return pwmchip_remove(&jz4740->chip);
}
static struct platform_driver jz4740_pwm_driver = {