From 3aa070eceb8e4e3ecc11fdc697fbee3b9d2e7cbb Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 8 Mar 2013 12:45:58 +0900 Subject: [PATCH] --- yaml --- r: 373579 b: refs/heads/master c: 482467ad97b633b28f57c347440d97c108dc4bfb h: refs/heads/master i: 373577: 7cb783a08b73699ce065128c4ae17d43ebb6c775 373575: 65629fa683a6c92da995d26e190e8326b919c58d v: v3 --- [refs] | 2 +- trunk/drivers/pwm/pwm-ab8500.c | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index a498992dc18f..fdc27f83d68a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c791126b93e800c68557483235321b201c082910 +refs/heads/master: 482467ad97b633b28f57c347440d97c108dc4bfb diff --git a/trunk/drivers/pwm/pwm-ab8500.c b/trunk/drivers/pwm/pwm-ab8500.c index 4248d0418273..93af1bbf88ce 100644 --- a/trunk/drivers/pwm/pwm-ab8500.c +++ b/trunk/drivers/pwm/pwm-ab8500.c @@ -99,7 +99,7 @@ static int ab8500_pwm_probe(struct platform_device *pdev) * Nothing to be done in probe, this is required to get the * device which is required for ab8500 read and write */ - ab8500 = kzalloc(sizeof(*ab8500), GFP_KERNEL); + ab8500 = devm_kzalloc(&pdev->dev, sizeof(*ab8500), GFP_KERNEL); if (ab8500 == NULL) { dev_err(&pdev->dev, "failed to allocate memory\n"); return -ENOMEM; @@ -111,10 +111,8 @@ static int ab8500_pwm_probe(struct platform_device *pdev) ab8500->chip.npwm = 1; err = pwmchip_add(&ab8500->chip); - if (err < 0) { - kfree(ab8500); + if (err < 0) return err; - } dev_dbg(&pdev->dev, "pwm probe successful\n"); platform_set_drvdata(pdev, ab8500); @@ -132,7 +130,6 @@ static int ab8500_pwm_remove(struct platform_device *pdev) return err; dev_dbg(&pdev->dev, "pwm driver removed\n"); - kfree(ab8500); return 0; }