2012-08-06 09:32:25

by Jingoo Han

[permalink] [raw]
Subject: [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem

This patch removes goto err_free_mem, which makes code a bit smaller.

Cc: Hans-Christian Egtvedt <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Jingoo Han <[email protected]>
---
drivers/video/backlight/atmel-pwm-bl.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
index df1cbb7..832d07d 100644
--- a/drivers/video/backlight/atmel-pwm-bl.c
+++ b/drivers/video/backlight/atmel-pwm-bl.c
@@ -135,24 +135,20 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
pwmbl->pdev = pdev;

pdata = pdev->dev.platform_data;
- if (!pdata) {
- retval = -ENODEV;
- goto err_free_mem;
- }
+ if (!pdata)
+ return -ENODEV;

if (pdata->pwm_compare_max < pdata->pwm_duty_max ||
pdata->pwm_duty_min > pdata->pwm_duty_max ||
- pdata->pwm_frequency == 0) {
- retval = -EINVAL;
- goto err_free_mem;
- }
+ pdata->pwm_frequency == 0)
+ return -EINVAL;

pwmbl->pdata = pdata;
pwmbl->gpio_on = pdata->gpio_on;

retval = pwm_channel_alloc(pdata->pwm_channel, &pwmbl->pwmc);
if (retval)
- goto err_free_mem;
+ return retval;

if (pwmbl->gpio_on != -1) {
retval = devm_gpio_request(&pdev->dev, pwmbl->gpio_on,
@@ -200,7 +196,6 @@ err_free_bl_dev:
backlight_device_unregister(bldev);
err_free_pwm:
pwm_channel_free(&pwmbl->pwmc);
-err_free_mem:
return retval;
}

--
1.7.1


Subject: Re: [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem

Around Mon 06 Aug 2012 18:32:09 +0900 or thereabout, Jingoo Han wrote:
> This patch removes goto err_free_mem, which makes code a bit smaller.
>
> Cc: Hans-Christian Egtvedt <[email protected]>
> Cc: Richard Purdie <[email protected]>
> Signed-off-by: Jingoo Han <[email protected]>

Acked-by: Hans-Christian Egtvedt <[email protected]>

<snipp diff>

--
Hans-Christian Egtvedt