mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem
@ 2012-08-06  9:32 Jingoo Han
  2012-08-06 10:49 ` Hans-Christian Egtvedt
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2012-08-06  9:32 UTC (permalink / raw)
  To: 'Andrew Morton', 'LKML'
  Cc: 'Richard Purdie', 'Hans-Christian Egtvedt',
	'Jingoo Han'

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

Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem
  2012-08-06  9:32 [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem Jingoo Han
@ 2012-08-06 10:49 ` Hans-Christian Egtvedt
  0 siblings, 0 replies; 2+ messages in thread
From: Hans-Christian Egtvedt @ 2012-08-06 10:49 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Andrew Morton', 'LKML', 'Richard Purdie'

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 <egtvedt@samfundet.no>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>

<snipp diff>

-- 
Hans-Christian Egtvedt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-06 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06  9:32 [PATCH 1/3] backlight: atmel-pwm-bl: remove goto err_free_mem Jingoo Han
2012-08-06 10:49 ` Hans-Christian Egtvedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®